I'm trying to use jregex and I've found something that seems to be a bug.
I'm using startWith combined with Named backreferences. And if I cut the reference, the startWith method returns false even when it should be true.
Here is the code:
Pattern p = new Pattern( "({ones}1*)a*{\\ones}" );
String testCase = "11a1";
System.err.println( testCase + " startsWith() for the pattern:" + p.startsWith(testCase) );
but, if I change the testCase to "11a11" or "11a" it works fine.
Thank's in advance for your time,
Aureliano.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi!
I'm trying to use jregex and I've found something that seems to be a bug.
I'm using startWith combined with Named backreferences. And if I cut the reference, the startWith method returns false even when it should be true.
Here is the code:
Pattern p = new Pattern( "({ones}1*)a*{\\ones}" );
String testCase = "11a1";
System.err.println( testCase + " startsWith() for the pattern:" + p.startsWith(testCase) );
but, if I change the testCase to "11a11" or "11a" it works fine.
Thank's in advance for your time,
Aureliano.
Hello, Aureliano!
You've just discovered a bug.
This startsWith() functionality is rather experimental,
hence such a thing. Repost it to bug tracker.
Best Regards
Sergey
I''ve reported this bug to the bug tracker.