axiak/pyre2

Add ability to choose regex encoding type

spender-sandbox opened this issue · 0 comments

Would it be possible to add support for Latin-1 encoding of regexes? Currently the re2 module can't be used as a drop-in replacement of 're' for pretty simple regex searches of binary data because of it forcing UTF-8 encoding on the regexes.
https://github.com/axiak/pyre2/blob/master/src/re2.pyx#L950

RE2 itself supports it, it would just be a matter of adding the option to pass _re2.EncodingLatin1 there.

Thanks!
-Brad