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

Match arbitrary bytes #134

Merged
merged 17 commits into from
Jan 5, 2024
Merged

Match arbitrary bytes #134

merged 17 commits into from
Jan 5, 2024

Conversation

nitely
Copy link
Owner

@nitely nitely commented Jan 3, 2024

fixes #108

this needs some refactor and tests

let flags = {regexArbitraryBytes}
doAssert match("\xff", re2(r"\xff", flags))
doAssert replace("\xff", re2(r"\xff", flags), "abc") == "abc"

TODO:

  • change the parser so the pattern is iterated as chars instead of runes when setting the flag. So re2("弢", flags) matches "弢" and arbitrary bytes match arbitrary bytes. Also, runes() expect valid utf8 so this is the only way.
  • tests
  • docs

@nitely nitely merged commit 77aa186 into master Jan 5, 2024
@nitely nitely deleted the binary branch January 5, 2024 10:36
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.

Support binary input
1 participant