I have a statement which finds strings that contain one character, say P. This works when matching against a string delimited by no white space
e.g.
APAXA
Thr regex being ^[^P]*P[^P]*$
It picks this string out fine, however, what if I have a string
XPA DREP EDS
What would be the regex to identify all strings in one line that match the condition (strings always seperated by some kind of white space - tab, space etc)?
e.g. how would I highlight XPA and DREP
I am using while(m.find())
to loop multiple times and System.out.println(m.group())
so m.group has to contain the entire string.