Skip to content

Add ability to choose regex encoding typeΒ #38

@spender-sandbox

Description

@spender-sandbox

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions