inspectit-ocelot icon indicating copy to clipboard operation
inspectit-ocelot copied to clipboard

Add a specialized RegEx cache

Open JonasKunz opened this issue 6 years ago • 0 comments

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

JonasKunz avatar Jun 25 '19 09:06 JonasKunz