It would cover a nice niche use case if we could have a function that takes a number of regular expressions and returns true for each of the ones that matches (or calls an appropriate callback). This is a case where you normally would use multiple regular expressions and test each of them in turn and is a subset of normal lexer operation
In essence;
Make a variant of the lexer that reports all matches when run to the end of an input stream instead of only the highest ranking token.
Make some Multimatch class that takes an array of regular expressions and delegates and makes a lexer. This should have a function "Match" that feeds an input string and does callbacks for all the tokens that matches.
It would cover a nice niche use case if we could have a function that takes a number of regular expressions and returns true for each of the ones that matches (or calls an appropriate callback). This is a case where you normally would use multiple regular expressions and test each of them in turn and is a subset of normal lexer operation
In essence;