I have an unlimited sequence of strings and numerous regular expressions ordered by priorities. For each string in a sequence I have to to find the first matching regular expression and the matched substring. Strings are not very long (<1Kb) while the number of regular expressions may vary from hundreds to thousands.
I'm looking for a Java tool that would do this job efficiently. I guess the technique should be building DFA ahead.
My current option is JFLEX. The problem I can't workaround in JFLEX is that its rules have no priorities and JFLEX looks for the rule matching the longest part of text.
My question is whether my problem could be solved with JFLEX? If not, can you suggest another Java tool/technique that would do?