m-ender / retina

A regex-based programming language.
MIT License
231 stars 10 forks source link

Option to invert matches for transliteration mode #54

Closed m-ender closed 6 years ago

m-ender commented 8 years ago

It might be useful to have an option to transliteration mode where the transliteration happens to all characters that weren't matched.

m-ender commented 7 years ago

It might be good to have this as a general thing for all stages. When used in substitutions there could be new syntax like $<1 and $>1 to retrieve the capturing groups of adjacent matches. If these also exist in the matches themselves to retrieve some properties of the adjacent non-matches then something like $<' would be a shorthand for $&$'.

m-ender commented 6 years ago

This has been added to Retina 1.0 as a generic feature for all stages (although it's not useful on all stages). I don't have those substitution features yet, but they're on the list for 1.0 as well.