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
The regex might seem a bit far-fetched, I have actually stumbled upon the issue with the regex a.{5}i, and just reduced for the reproducibility.
The bug does not exhibit when using "a.i". From what I can understand from some debugging:
For the "a.{1}c" regex, the "a" literal is extracted. On a match, we do:
an ascii forward match: this fails
a wide forward match: this succeeds.
the backward validator does nothing
there is match
For the "a.{1}1" regex, the "1" literal is extracted. On a match, we do:
an ascii forward match: this succeeds as it matches "1"
an ascii backward match: this fails
there is no match
The "a.i" regex gets expanded into literals, hence no bug as it is related to ascii/wide detection on the AC literal matched.
So from what i can tell, the issue can happen when the ascii forward matcher is a prefix of the wide forward matcher. I should thus be possible to trigger with raw strings or hex strings, or even with some clever xor transformation, however I haven't tried to come up with more "realistic" strings that could trigger this bug.
The text was updated successfully, but these errors were encountered:
Describe the bug
With some regexes marked as "ascii wide", no matches are reported on inputs that should match.
To Reproduce
Here are some tests cases showing the issue:
Expected behavior
The second test case should match.
Additional context
The regex might seem a bit far-fetched, I have actually stumbled upon the issue with the regex
a.{5}i
, and just reduced for the reproducibility.The bug does not exhibit when using "a.i". From what I can understand from some debugging:
So from what i can tell, the issue can happen when the ascii forward matcher is a prefix of the wide forward matcher. I should thus be possible to trigger with raw strings or hex strings, or even with some clever xor transformation, however I haven't tried to come up with more "realistic" strings that could trigger this bug.
The text was updated successfully, but these errors were encountered: