Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport 1.17] fix: Handle escape and regex characters #932

Merged
merged 4 commits into from
Sep 25, 2024

Conversation

backport-action
Copy link
Collaborator

Description

Backport of #930 to 1.17.

relates to #883 #879
original author: @saig0

(cherry picked from commit 58efca9)
Correct the handling of escape sequences in string literals.

Don't replace escape sequences in regex expressions, for example, \r or \n. In the parser, these sequences start with \\. Same for \s, don't replace it with a whitespace, since this is also a part of a regex.

Handle \\ to avoid that the sequence is escaped and returned as \\\\.

(cherry picked from commit d266e80)
@saig0 saig0 merged commit 2a4ea4c into 1.17 Sep 25, 2024
4 checks passed
@saig0 saig0 deleted the backport-930-to-1.17 branch September 25, 2024 11:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants