Does Java perform any regex optimisations; if so, what are they?
I'm interested in both optimisations at the regex engine level, and more general usage-level optimisations.
(For example, in some other languages, commonly used regexes are cached to avoid re-compiling, but what I've read so far implies that Java doesn't do this automatically?)
To be clear:
I'm not asking for how to optimise the actual regular expressions themselves. I'm asking about actions that might happen automatically, inside the regex engine.