Open
Description
I want to try a bunch of patterns from one start index, then try them all again from the end position of the first match, if there was a match, until I get to the point where there are no matches.
The only way to do this right now is to use allMatches with a start index and then see if the result has any values and if so return the first one. This is rather awkward.
It would be cleaner if I could just use "firstMatch" with a start index. (For completeness, hasMatch and matchString also should have a start argument.)
Note that "matchAsPrefix" has a start index argument, but that doesn't help because it implies an anchored match at the start of the pattern. This would only work if the patterns all started with .*?
, which they don't.