Part of the code I\'m working on uses a bunch of regular expressions to search for some simple string patterns (e.g., patterns like \"foo[0-9]{3,4} bar\"). Currently, we use sta
You could try using the Pattern.matches()
static method which would just return the boolean. That wouldn't return a Matcher
object so it could help with the memory allocation issues.
That being said the regex pattern would not be precompiled so it would be a performance vs resources thing at the point.