Another startWithBug
Brought to you by:
samokhodkin
"1" isn't a prefix for "1{2}"
test code:
public static void main(String[] args) {
Pattern p = new Pattern( "1{2}" );
String testCase = "1";
System.err.println( testCase + " is prefix? " +
p.startsWith(testCase) );
}
and shows "1 is prefix?false"
Logged In: YES
user_id=908396
I think you misunderstand what Pattern.startsWith does. "1"
is not a prefix of the pattern "1{2}". It would be a prefix
of the pattern "11", just as "11" would be a prefix of
"1{2}". Very confusing, though. (Also see my comment to bug
667201.)