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

Generate \x{...} instead of \x... in regular expressions #7

Merged
merged 2 commits into from
Jul 16, 2024

Conversation

sungshik
Copy link
Collaborator

This PR fixes a small bug in the conversion of chars in regular expressions.

@sungshik sungshik requested a review from DavyLandman July 16, 2024 12:35
@DavyLandman
Copy link
Member

Hmm, that is strange, the manual said the 1byte chars were allowed to be encoded as \xHH instead of \x{HH}

@sungshik
Copy link
Collaborator Author

Davy and I investigated this a bit further and:

  • The docs state \xHH is for "encoded byte value", while \x{HH} is for "code point value"
  • Only up to 7F, encoded bytes and code points coincide
  • As a result, \xHH gives unexpected results beyond 7F (the bug of this PR) and \x{HH} should be used instead (the fix)

@sungshik sungshik merged commit 6842b97 into main Jul 16, 2024
2 checks passed
@sungshik sungshik deleted the brackets-for-x-in-regexes branch July 16, 2024 13:45
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.

2 participants