Adding lookbehinds to rust-lang/regex
systemf.epfl.ch
Adding lookbehinds to rust-lang/regex
1–10 of 36 posts
Re: Adding lookbehinds to rust-lang/regex
#2If anyone knows (to let me be lazy), is this the same regex engine used by ripgrep? Or is that an independent implementation?
Re: Adding lookbehinds to rust-lang/regex
#3Great! I enjoyed reading through, and I'm going to come back later and read a little more carefully. If anyone knows (to let me be lazy), is this the same regex engine used by ripgrep? Or is that an independent implementation?
Re: Adding lookbehinds to rust-lang/regex
#4Re: Adding lookbehinds to rust-lang/regex
#5Great! I enjoyed reading through, and I'm going to come back later and read a little more carefully. If anyone knows (to let me be lazy), is this the same regex engine used by ripgrep? Or is that an independent implementation?
Re: Adding lookbehinds to rust-lang/regex
#6Re: Adding lookbehinds to rust-lang/regex
#7When I use regex, I expect to be able to lookbehind, so I am routinely hit by RE2's limitations in places where it's used. Sometimes the software uses the entire matched string and you can't use non-capturing groups to work around it.
I understand go's reasons, ReDoS etc, but the "purism" of RE2 does fly in the face of practicality to an irksome degree. This is not uncommon for go.
Re: Adding lookbehinds to rust-lang/regex
#8I wonder in what situation someone would even be tempted to put a capture group into a lookbehind expression, except unintentionally by using () instead of (?:) for grouping. Maybe in an attempt to obtain capture groups from overlapping matches? But even in that case, lookaheads would be clearer, when available.
Re: Adding lookbehinds to rust-lang/regex
#9Searching for a simple explanation of how it works, I found this which also explains negative look behind and look ahead. TIL:
Re: Adding lookbehinds to rust-lang/regex
#10From a user perspective, this is extremely valuable. What an amazing improvement; unbounded especially. I do hope this would make it into actual RE2 & go. When I use regex, I expect to be able to lookbehind, so I am routinely hit by RE2's limitations in places where it's used. Sometimes the software uses the entire matched string and you can't use non-capturing groups to work around it. I understand go's reasons, ReD…
For instances where you need something more sophisticated than what’s in the standard library, you reach for 3rd party modules. And there are regex libraries for Go which support backtracking et al.
There’s definitely some irksome defaults in Go, but the choose of regex engine in the regexp library isn’t one of them