Closed m-ender closed 6 years ago
I think both would be useful.
In Retina 1.0, each stage can be given several regex/substitution pairs. There are two ways to use these: cyclic or greedy. In the case of greedy, each regex is attempted and the earliest match and corresponding substitution is used. So this sort of covers this. There'll also be more generic conditionals, which let you choose between one or more stages depending on whether a (separate) regex matches, which also covers this.
It would sometimes be useful to skip a stage and do the next one instead if the regex doesn't match at all. Maybe this should also be generalised to groups somehow, but then I think the only sensible condition is whether the group changed the string or not. Maybe provide both?