boon icon indicating copy to clipboard operation
boon copied to clipboard

regex Crate Does not Support look-around

Open theory opened this issue 1 year ago • 1 comments

I used regex-info to build an ECMAScript regex to match Unix-style relative file paths. To prevent .. from appearing at the start, I used a look-ahead assertion, ^(?![.]{2}\/). Alas, the regex crate does not support look-arounds:

The regex syntax supported by this crate is similar to other regex engines, but it lacks several features that are not known how to implement efficiently. This includes, but is not limited to, look-around and backreferences.

I'm just getting familiar with Rust myself, but in poking around, like in rust-lang/regex#841, it looks like the solution is to use fancy_regex instead. I wonder if that would make sense here, or if using something like ecma_regex would be more appropriate…

theory avatar Jul 17 '24 21:07 theory

I am having this issue as well :)

awgneo avatar Apr 15 '25 05:04 awgneo