You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a negative lookahead assertion is successful (i.e., the asserted regular expression does not match), some capture groups might be assigned in the asserted regular expression as if the lookahead regular expression had matched.
'(?!(a)b)..' matches 'ac': 1
capture group 1 matched: 1
Expected result
This should print:
'(?!(a)b)..' matches 'ac': 1
capture group 1 matched: 0
It follows from ECMA-262 3rd ed., Section 15.10.2.8 "Atom", that capture groups in negative lookahead assertions are never matched, whether the asserted regular expression matches or not.
The text was updated successfully, but these errors were encountered:
When a negative lookahead assertion is successful (i.e., the asserted regular expression does not match), some capture groups might be assigned in the asserted regular expression as if the lookahead regular expression had matched.
Test case
https://godbolt.org/z/EzjGrGP5K
This prints:
Expected result
This should print:
It follows from ECMA-262 3rd ed., Section 15.10.2.8 "Atom", that capture groups in negative lookahead assertions are never matched, whether the asserted regular expression matches or not.
The text was updated successfully, but these errors were encountered: