You are viewing a plain text version of this content. The canonical link for it is here.
Posted to regexp-user@jakarta.apache.org by Adam Jack <aj...@TrySybase.com> on 2003/04/17 20:39:06 UTC
ArrayIndexOutOfBoundsException
Hello,
I am using Jakarta RegExp 1.2.
I have a regular expression that compiles, yet crashes on me with certain
content (and not with other).
I can cause the behaviour or not (but not get what I need) by removing the
( and ) around the [a-z] in here:
Crashes:
// .MAJOR, .MINOR, .POINT,
// -RELEASE_LEVEL w/ QUALIFIER,
// -BUILD_NUMBER,
// -VARIANT, TYPE
+
"(-(\\d+)(\\.(\\d+))?(\\.(\\d+))?(-([a-z])+(\\d*))?(-(\\d*))?)?(-([^\\.]*))?
(\\..*)?"
Does not crash:
+
"(-(\\d+)(\\.(\\d+))?(\\.(\\d+))?(-[a-z]+(\\d*))?(-(\\d*))?)?(-([^\\.]*))?(\
\..*)?"
Basically I am trying to match something like
foo-1.2.3-dev1-20032102-src.jar w/ lots of optional parts.
Maybe there is too much similarity within the -dev1 and -src parts, or maybe
it is nothing to do with that.
Below is the stack trace.
Any insights/help would be greatly appreciated.
Thanks in advance
regards
Adam
MetaInfo : Name:toto,Version: (toto|[major,minor,releaseLevel] (0,1)),
Varient:null, Type:null
Version : toto|[major,minor,releaseLevel] (0,1)
java.lang.ArrayIndexOutOfBoundsException: 16
at org.apache.regexp.RE.getParenEnd(RE.java:724)
at org.apache.regexp.RE.matchNodes(RE.java:942)
at org.apache.regexp.RE.matchNodes(RE.java:1376)
at org.apache.regexp.RE.matchNodes(RE.java:1376)
at org.apache.regexp.RE.matchNodes(RE.java:1376)
at org.apache.regexp.RE.matchNodes(RE.java:1376)
at org.apache.regexp.RE.matchNodes(RE.java:910)
at org.apache.regexp.RE.matchNodes(RE.java:1376)
at org.apache.regexp.RE.matchNodes(RE.java:1376)
at org.apache.regexp.RE.matchNodes(RE.java:1376)
at org.apache.regexp.RE.matchNodes(RE.java:933)
at org.apache.regexp.RE.matchNodes(RE.java:1376)
at org.apache.regexp.RE.matchNodes(RE.java:933)
at org.apache.regexp.RE.matchNodes(RE.java:1376)
at org.apache.regexp.RE.matchNodes(RE.java:910)
at org.apache.regexp.RE.matchNodes(RE.java:1376)
at org.apache.regexp.RE.matchNodes(RE.java:933)
at org.apache.regexp.RE.matchNodes(RE.java:1376)
at org.apache.regexp.RE.matchNodes(RE.java:910)
at org.apache.regexp.RE.matchNodes(RE.java:1376)
at org.apache.regexp.RE.matchNodes(RE.java:933)
at org.apache.regexp.RE.matchNodes(RE.java:1376)
at org.apache.regexp.RE.matchNodes(RE.java:910)
at org.apache.regexp.RE.matchNodes(RE.java:1376)
at org.apache.regexp.RE.matchNodes(RE.java:910)
at org.apache.regexp.RE.matchAt(RE.java:1448)
at org.apache.regexp.RE.match(RE.java:1498)
at org.apache.regexp.RE.match(RE.java:1468)
at org.apache.regexp.RE.match(RE.java:1561)
at
org.krysalis.ruper.model.impl.FilenameInfoExtractor.parseStandardFormat(File
nameInfoExtractor.java:252)
at
org.krysalis.ruper.model.impl.FilenameInfoExtractor.parse(FilenameInfoExtrac
tor.java:177)
at
org.krysalis.ruper.model.impl.FilenameInfoExtractor.main(FilenameInfoExtract
or.java:394)
Exception in thread "main"
--
<http://www.try.sybase.com>
Experience Sybase Technology ...
---------------------------------------------------------------------
To unsubscribe, e-mail: regexp-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: regexp-user-help@jakarta.apache.org
Re: ArrayIndexOutOfBoundsException
Posted by Mario Diana <ma...@mac.com>.
On Thursday, April 17, 2003, at 02:39 PM, Adam Jack wrote:
> I have a regular expression that compiles, yet crashes on me with
> certain
> content (and not with other).
>
> [...]
>
> Below is the stack trace.
>
> [...]
>
> java.lang.ArrayIndexOutOfBoundsException: 16 [...]
There's a bug in the implementation that's been fixed in the source
files on the CVS system. There's been no build for it, so you'll have to
download the latest files and build them yourself.
They build with Ant, so get that if you don't have it.
I did this back in November after experiencing the same problem. I think
I found the solution in the archives of this list -- you can search to
confirm if you like. The problem stems from the "non-greedy"
symbol ("?").
I also remember reading that someone was going to build the latest CVS
files into a distribution when they got the time, and I'm wondering if
that's still true.
Good luck!
Mario Diana
---------------------------------------------------------------------
To unsubscribe, e-mail: regexp-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: regexp-user-help@jakarta.apache.org