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
Simple alternative:
if (!csv.startsWith("agg") { // do something }