G
gill.jp
I am trying to get all the names i.e: SMITH J , BALTIMORE D, JONES AL
String input = "NAME=(SMITH J) NAME=(BALTIMORE D) NAME=(JONES AL)
JUNK=(ABC);
Pattern pattern = Pattern.compile(" ");
Matcher matcher = pattern.matcher(input);
for (int i=0; i<=matcher.groupCount(); i++) {
String groupStr = matcher.group(i);
System.out.println("groupStr: "+ groupStr);
}
I played around with few patterns, I am unable to get all of the
names.
Anyone knows what this regex might be?
Thanks, J
String input = "NAME=(SMITH J) NAME=(BALTIMORE D) NAME=(JONES AL)
JUNK=(ABC);
Pattern pattern = Pattern.compile(" ");
Matcher matcher = pattern.matcher(input);
for (int i=0; i<=matcher.groupCount(); i++) {
String groupStr = matcher.group(i);
System.out.println("groupStr: "+ groupStr);
}
I played around with few patterns, I am unable to get all of the
names.
Anyone knows what this regex might be?
Thanks, J