Yes, essentially matchAll with multiple patterns is a poor man's lexer. Or scripting man's depending on how you look, plus combined with static regex it may get competitive sometime soon.

I think alias this would return 1-based index of matched pattern. I just wondering if combined with opCast(T:bool) it won't go haywire. It would make sense to expose number of match also via a property.