I tried from https://docs.oracle.com/javase/1.5.0/docs/api/java/util/regex/Pattern.html.
I have
Pattern PATTERN = Pattern.compile(\"agg{0}.*\"); Matcher
Check contains , it's a method of String
String