Bug 1030 - {n,m} notation failure in org.apache.regexp.RE.match
Summary: {n,m} notation failure in org.apache.regexp.RE.match
Status: CLOSED DUPLICATE of bug 19329
Alias: None
Product: Regexp
Classification: Unclassified
Component: Other (show other bugs)
Version: unspecified
Hardware: PC All
: P3 normal with 1 vote (vote)
Target Milestone: ---
Assignee: Jakarta Notifications Mailing List
: 2487 14689 (view as bug list)
Depends on:
Reported: 2001-03-19 14:05 UTC by Michael O. Duffy
Modified: 2004-11-16 19:05 UTC (History)
2 users (show)


Note You need to log in before you can comment on or make changes to this bug.
Description Michael O. Duffy 2001-03-19 14:05:50 UTC
I asked jakarta-regexp-1.2 to test the string "111111" against the regexp 
pattern "^\d{0,5}(\.\d\d)?$".  I believe this string should have failed, but 
the method org.apache.regexp.RE.match() returned "true" when it should have 
returned "false".

I tested the same string using the ORO and GNU libraries - both agreed that 
this string should not match this pattern.

I ran all examples under Windows 2000 using JDK 1.3.
Comment 1 sanders 2001-04-23 11:38:30 UTC
I have found some associated problems with with the {n,m} notation.  It doesn't
appear to work correctly with 0 as a lower bound, and the upper bound allows one
higher than it should.

For the pattern: a(b{0,1})a

Test String    Matches     Should Match
aa              false          true
aba             true           true
abba            true           false
abbba           false          false

I got these results with Sun's Linux 1.3 SDK, and Win NT 1.3 SDK.
Comment 2 Michael McCallum 2001-09-08 15:46:07 UTC
This is definitly a problem.
Have not nailed down exactly why its happening though.
Comment 3 Michael McCallum 2001-09-08 15:57:09 UTC
*** Bug 2487 has been marked as a duplicate of this bug. ***
Comment 4 Vadim Gritsenko 2003-04-25 12:28:37 UTC
*** Bug 14689 has been marked as a duplicate of this bug. ***
Comment 5 Vadim Gritsenko 2003-04-25 17:54:46 UTC

*** This bug has been marked as a duplicate of 19329 ***
Comment 6 Vadim Gritsenko 2003-05-02 01:09:01 UTC
Fixed by Bug #19329