inspectit-ocelot
inspectit-ocelot copied to clipboard
Add a specialized RegEx cache
Regexes are commonly used in instrumentation, e.g. for extracting data or for defining business transactions. To efficiently use RegExes in Java, they need to be compilted to Patterns.
These patterns should be cached, which can already be done using "_cache". However, it would be nice to have a specialized cache, providing a much easier API:
_regex.matches("\\d+",stringToTest) //return true or false
_regex.pattern("\\d+") //returns the compiled pattern for the given regex