I have a statement that finds strings containing one character, for example P. This works when matching with a string limited to without spaces
eg.
APAXA
Thr regex ^[^P]*P[^P]*$
He selects this line perfectly, however, what if I have a line
XPA DREP EDS
What will be the regular expression for identifying all the lines in one line that matches the condition (the lines are always separated by some white space - tab, space, etc.)?
eg. how would I highlight XPA and DREP
I use while(m.find()) to loop several times and System.out.println (m.group ())
therefore m.group must contain the entire string.
source share