lpil/rustexp

Support non-unicode flag

Open

#10 opened on Apr 2, 2020

View on GitHub
 (0 comments) (1 reaction) (0 assignees)Rust (21 forks)github user discovery
help wanted

Repository metrics

Stars
 (130 stars)
PR merge metrics
 (PR metrics pending)

Description

It would be cool to support the regex::bytes::Regex matcher using the non-unicode flag. If I try this regex:

(?-u).

I get the following error:

Syntax(
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
regex parse error:
    (?-u).
         ^
error: pattern can match invalid UTF-8
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
)

In fact you may just want to use the regex::bytes::Regex unconditionally.

Contributor guide