DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22997>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22997

RE throws ArrayIndexOutOfBounds when grouping repetition is >= 16

           Summary: RE throws ArrayIndexOutOfBounds when grouping repetition
                    is >= 16
           Product: Regexp
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Other
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


For the following code snippet:

String s = "1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 ";
org.apache.regexp.RE re = new org.apache.regexp.RE("([0-9]+ ){17}");
System.out.println(re.match(s));

Basically i have a string s that consists of a number followed by a whitespace,
repeated 17 times. To verify this pattern, my RE uses "[0-9]+" to denote the 
number, followed by a whitespace " ", and the 2 are grouped by "()", then 
followed by the repetition operator {n} (shown above n=17).

The match result should be "true" for n=1 to 17. it does return "true" if you 
start n from 1 and increase all the way to 15. But as soon as n >= 16, an 
ArrayIndexOutOfBounds will be thrown with the number "n", which seems to 
indicate some hard-coding of capacity somewhere in the code.

I tried this on both REGEXP 1.2 and 1.3. same results.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to