-
Type:
Bug
-
Resolution: Not an Issue
-
Priority:
P4
-
None
-
Affects Version/s: 8, 11, 17, 18, 19, 20
-
Component/s: core-libs
-
generic
-
generic
A DESCRIPTION OF THE PROBLEM :
The lookbehind section of a pattern can match text that comes before the start parameter
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the code from "Source code for an executable test case"
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
false
---------- BEGIN SOURCE ----------
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Test {
public static void main(String[] args) {
Pattern pattern = Pattern.compile("(?<=te)st");
Matcher matcher = pattern.matcher("test");
System.out.println(matcher.find(2));
}
}
---------- END SOURCE ----------
FREQUENCY : always
The lookbehind section of a pattern can match text that comes before the start parameter
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the code from "Source code for an executable test case"
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
false
---------- BEGIN SOURCE ----------
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Test {
public static void main(String[] args) {
Pattern pattern = Pattern.compile("(?<=te)st");
Matcher matcher = pattern.matcher("test");
System.out.println(matcher.find(2));
}
}
---------- END SOURCE ----------
FREQUENCY : always