rust-lang / regex

An implementation of regular expressions for Rust. This implementation uses finite automata and guarantees linear time matching on all inputs.

Home Page:https://docs.rs/regex

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Make regex_syntax generic to all regexes, not just those supported by `regex`

LeoDog896 opened this issue · comments

Describe your feature request

Move Unsupported errors away from regex_syntax and towards the regex crate, to allow regex_syntax to be a full AST parsing implementation similar to PCRE regexes, allowing for features usually unsupported by regex like backreferences.

Note: This is out of scope for the main goal of the crate, (and I fully understand if this is closed), however, as it stands, there is no feature complete AST regex syntax parser, and, given that regex_syntax is its own standalone crate, it seems fitting to add to the future set.

Others have requested something narrower than what you're asking (like supporting specific features like look-around) and I've turned them down. Similarly, I'll turn this request down as well. What you're asking is specifically an unbounded goal that would require an enormous amount of effort. I don't have the time or inclination to support such a task. My back-of-the-envelope guess is that this would make the parser an order of magnitude more complex. So this doesn't fall into the "it makes sense because regex-syntax is its own crate" bucket from my perspective. It more likely falls into the "it needs to be its own distinct project" bucket.