Skip to content

fix: solving the problem of escaped backslashes in regular expressions. #1701

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

Merged
merged 1 commit into from
May 9, 2023

Conversation

JohnhanLiu
Copy link
Contributor

@JohnhanLiu JohnhanLiu commented May 6, 2023

Fix

backslash which in regexp SHOULD NOT be escaped as a string.

Reproduce Sample Code

const regArr = [/hello\w+/];
const reg0 = regArr[0];
debugger;

Incorrect:

image

Correct

image

After fixed

image

@JohnhanLiu
Copy link
Contributor Author

@connor4312 PTAL :)

@JohnhanLiu
Copy link
Contributor Author

Hi, @connor4312, sorry to mention again.

Could you take a look and give me a little advice on this PR. In my opinion, it would be great to solve this problem ASAP.

@connor4312
Copy link
Member

The test failure is a separate thing I will fix in main. This PR lgtm, thanks for the contribution

@connor4312 connor4312 enabled auto-merge (squash) May 9, 2023 16:18
@Tyriar
Copy link
Member

Tyriar commented May 9, 2023

@connor4312 CI failing?

@connor4312 connor4312 merged commit 2d8e096 into microsoft:main May 9, 2023
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.

3 participants