m-ender / retina

A regex-based programming language.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Specify multiple regexes (yuck) for a stage

m-ender opened this issue · comments

There could be two options for using them:

  1. Cycle through the patterns (and corresponding substitutions if applicable).
  2. Try all patterns and greedily pick the one that gives the match closest to the last one (ties could be broken by the order the patterns are given in and/or length of the match).

This has been implemented and will be released as part of Retina 1.0. The syntax is #n for cycling through multiple patterns (and substitutions) and #-n for greedily picking from all patterns.