Regex101
Regex101 copied to clipboard
Translate existing regex to new flavor specs upon switch
Feature
For instance, I can write in Perl m/[^[:ascii:]]+/ to find any strings which have non-ascii characters. But now I want to use the same construct in Python (without having to think too much), but Python (for reasons I can't fathom) chooses not to allow these constructs. It would be nice to be able to have a button to translate a regex into language XYZ from another that we may be more familiar with. Another place I often get caught out is working in Perl and then switching to VIM.
This would be an amazing feature. Just tried to convert PCRE2 to ECMA.
I don't think this will be possible beyond rudimentary differences, such as (?P<name>...)
being converted to (?<name>...)
. How should things where there is no support be handled?
I strongly agree with this feature request. Automatic Flavor Conversion is an essential feature IMHO. Most of the times we found a RegEx in the library that does what we want, but it is in the wrong flavor. 90% of the times it's in the wrong one. Especially the substitution string. We spend too much time rewriting it, and often we just search other regex websites looking for a ready one in the flavor we need.