-
Bug
-
Resolution: Fixed
-
P3
-
1.4.0
-
None
-
beta
-
sparc
-
solaris_7
-
Verified
Matcher.group(int) returns a blank string instead of null if the match was successful but the group itself did not match anything.
So the folling piece of code
Pattern p = Pattern.compile("ab(c*)");
Matcher m = p.matcher("abababababa");
m.find();
System.out.println(m.group(1));
prints a blank string instead of null.
So the folling piece of code
Pattern p = Pattern.compile("ab(c*)");
Matcher m = p.matcher("abababababa");
m.find();
System.out.println(m.group(1));
prints a blank string instead of null.