match.matches() returns false. This is odd, because if I take this regex and test String to rubular.com, is shows two matches. What am I doing wrong?
Pattern regex = Pattern.compile("FTW(((?!ODP).)+)ODP");
Matcher match = regex.matcher("ZZZMMMJJJOOFTWZMJZMJODPZZZMMMJJJOOOFTWMZJOMZJOMZJOODPZZZMMMJJJOO");
if (match.matches()) {
System.out.println("match found");
}
else {
System.out.println("match not found");
}