Regex101 icon indicating copy to clipboard operation
Regex101 copied to clipboard

Translate existing regex to new flavor specs upon switch

Open rosyth opened this issue 3 years ago • 3 comments

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.

rosyth avatar Jul 28 '21 10:07 rosyth

This would be an amazing feature. Just tried to convert PCRE2 to ECMA.

angusryer avatar Aug 27 '21 21:08 angusryer

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?

firasdib avatar Dec 09 '21 17:12 firasdib

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.

Emasoft avatar Jul 02 '22 18:07 Emasoft