In C#, is there any way to try multiple Regexes on string to see which one matches first?
- by Matt
Let's say I have an arbitrary list of regexes (IList<Regex> lst; for example). Is there any way to find out which one matches first?
Of course there is the straightforward solution of trying each one on the string and seeing which match has the lowest index, but this could be inefficient on long strings.
Of course I can go back and pull the…