I'm not sure that there is a huge performance gap between the various regexp java engines.
But when building a regular expression (and that is, if the data is large enough, there is a performance problem) noted by Jeff Atwood )
The only thing you should avoid is a catastrophic rollback , it is better to avoid when using the atomic grouping .
So, by default, I would use the java.utils.regexp mechanism if you do not have certain perl-compatible regexp sources that need to be reused in your program.
Then I would carefully construct the regex that I intend to use.
But from the point of view of choosing one engine or another ... since he was told in other questions :
- "make it work, do it fast - in that order"
- Beware of "premature optimization."
Vonc
source share