-
Notifications
You must be signed in to change notification settings - Fork 40
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 processing using {n,m} repeat syntax is off by one #1632
Labels
Bug
Something isn't working
Comments
Thank you for the ticket. Interestingly at least for this reproducer this seems to work for max lengths 1 and 2, and fail for any other max length. module foo;
assert |*b"\x00\x00\x00\x00\x00\x00\x00".match(/\x00{0,1}/)| == 1; # WORKS.
assert |*b"\x00\x00\x00\x00\x00\x00\x00".match(/\x00{0,2}/)| == 2; # WORKS.
assert |*b"\x00\x00\x00\x00\x00\x00\x00".match(/\x00{0,3}/)| == 3; # FAILS.
assert |*b"\x00\x00\x00\x00\x00\x00\x00".match(/\x00{0,4}/)| == 4; # FAILS.
assert |*b"\x00\x00\x00\x00\x00\x00\x00".match(/\x00{0,5}/)| == 5; # FAILS. |
Since this very likely is in https://github.com/rsmmr/justrx, is this something you could look into @rsmmr? |
rsmmr
added a commit
that referenced
this issue
Jan 5, 2024
rsmmr
added a commit
that referenced
this issue
Jan 8, 2024
rsmmr
added a commit
that referenced
this issue
Jan 9, 2024
rsmmr
added a commit
that referenced
this issue
Jan 9, 2024
* origin/topic/robin/gh-1632-regex-fix: Bump justrx to pull in bugfix.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you have a unit that has a 4 byte field followed by 0 to 3 null bytes, but the input has 5 null bytes on the end, the resulting output shows 4 null bytes when it should be 3 null bytes. See the following code for details.
Version:
spicy-driver v1.9.0 (7b8eff5)
Code:
Command:
printf '\01\02\03\04\00\00\00\00\00' | spicy-driver regex-broken-repeat-syntax.spicy
Result:
The text was updated successfully, but these errors were encountered: