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

Regex matching should backtrack #77

Open
y21 opened this issue Jan 5, 2024 · 0 comments
Open

Regex matching should backtrack #77

y21 opened this issue Jan 5, 2024 · 0 comments
Labels
A-vm V-regex vm area: regex

Comments

@y21
Copy link
Owner

y21 commented Jan 5, 2024

console.log(/.+a/.test('bba'));

This should return true, but currently returns false, because .+ eagerly consumes the whole string.
Instead it should work its way backwards and realize that .+ should only match bb.

@y21 y21 added A-vm V-regex vm area: regex labels Jan 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-vm V-regex vm area: regex
Projects
None yet
Development

No branches or pull requests

1 participant