-
Bug
-
Resolution: Unresolved
-
P4
-
8, 9
-
Cause Known
-
generic
-
generic
FULL PRODUCT VERSION :
1.8.0_144
A DESCRIPTION OF THE PROBLEM :
When matching against a regular expression that has nested capturing groups inside a greedy repetition, the nested capturing groups aren't correctly backtracked..
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1) compile the pattern "([a-z]([a-z]))+[a-z][a-z]"
2) match against the input "abcdef"
3) check the value of group 2
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Group 2 should have the value "d"
ACTUAL -
Actually, Group 2 has the value "f"
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
Pattern p = Pattern.compile("([a-z]([a-z]))+[a-z][a-z]");
Matcher m = p.matcher("abcdef");
if(m.matches() ){
System.out.println("Group 2 is " + m.group(2) );
}
---------- END SOURCE ----------
1.8.0_144
A DESCRIPTION OF THE PROBLEM :
When matching against a regular expression that has nested capturing groups inside a greedy repetition, the nested capturing groups aren't correctly backtracked..
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1) compile the pattern "([a-z]([a-z]))+[a-z][a-z]"
2) match against the input "abcdef"
3) check the value of group 2
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Group 2 should have the value "d"
ACTUAL -
Actually, Group 2 has the value "f"
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
Pattern p = Pattern.compile("([a-z]([a-z]))+[a-z][a-z]");
Matcher m = p.matcher("abcdef");
if(m.matches() ){
System.out.println("Group 2 is " + m.group(2) );
}
---------- END SOURCE ----------
- duplicates
-
JDK-8187537 Regular expression wrong start position of matching group
-
- In Progress
-