DFA Based regular expression engine with captured Java

Is there any (free) regular expression engine for Java that can compile regular expressions into DFA and capture combinations when matching DFA?

I found DK brics. Automaton and jrexx, both of which are compiled into DFA, do not seem to be able to perform group capture Other engines I found seem to be compiled into NFA

Solution

Try this (it may not be DFA, but it's faster than Java. Util) http://jregex.sourceforge.net/gstarted-advanced.html#ngroups , or this: http://userguide.icu-project.org

According to the test: http://tusker.org/regex/regex_benchmark.html , both are fast (we all know that benchmarking only tests what the creator of the benchmark wants to test)

When I needed a really fast DFA regular expression, I generated one using grep; -) For 6GB log files, it reduces my time from 10 minutes to a few seconds

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>