Skip to content

Matching on partial UTF-8 characters #801

Answered by RReverser
jszwedko asked this question in Q&A
Discussion options

You must be logged in to vote

You probably missed the important part from the beginning of cited example: (?-u)

The description below explains further:

The u flag can be disabled even when disabling it might cause the regex to match invalid UTF-8. When the u flag is disabled, the regex is said to be in “ASCII compatible” mode.

That is, by default the bytes::Regex only allows UTF-8, just like regular Regex, the difference is that it allows you to opt-out and search for bytes too.

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
3 replies
@BurntSushi
Comment options

@jszwedko
Comment options

@jszwedko
Comment options

Answer selected by jszwedko
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants