This is my code:
Pattern p = Pattern.compile(":\\s(.+)\\s[cfs]");
Matcher m1 = p.matcher("Seat 9: -FACERAPE- folded before Flop");
String name = null;
while(m1.find()){
name = m1.group(1);
}
System.out.println(name);
I tried this regex pattern here and it works there but in my IDE it does not work. I use Eclipse with jdk 1.6. Also my regex works with these examples: Seat 7: Goldball31 folded before Flop, Seat 4: <*{{{>< collected (3.09). As you see problem is in hyphen but I did not get what a problem.
Oh sorry forget that it prints “null”
I don’t see anything wrong, but your regular expression should be:
or