m-ender/retina

Conditional replacement syntax

Opened this issue · 1 comments

Boost has conditional replacement syntax, where you can choose between two substitutions based on whether a given group was matched or not. That feature would be really useful, although I'd probably change the syntax to ${cond?true:false} (as neither ? nor : are part of valid group names).

A limited way of this is possible in Retina 1.0 by doing something like ${$1} where $1 evaluates to which other group you want to include. Not quite as flexible, but it's a start.