I have this pattern:
Pattern.compile(".*?\\[ISOLATION GROUP (^]+)].*");
I assumed this would match, for example, these two strings:
"[ISOLATION GROUP X] blabla"
"[OTHER FLAG][ISOLATION GROUP Y] blabla"
and then with group(1)
I could get the name of the isolation group (in the above examples, "X" resp. "Y")
However the matches()
is not even returning true. Why do these strings not match that pattern, what is wrong with the pattern?