Re: Stack Overflow Problmen - reformat regular expression
"Ulla (Ulrike) Schat" <[email protected]> Wed, 11 Feb 2004 16:27:13 +0100
| Newsgroups | gmane.comp.jakarta.oro.user |
|---|---|
| Message-ID | <[email protected]> |
Hello again,
I am terribly sorry but I didn't check the result of the new regular
expression well enough. I was so happy that it solved the Stack Overflow
Error that I just believed it would be fine. :-(
But now I saw that from the ending of the input String "...-}", it
leaves the "-" which should not be included in the result.
There is always something before the "-}" so it is ok to use + and not
*. But also with the old expression, using + instead of *,
"{(\\d+):(([^}](?!-}))+)", I get the StackOverflowError if the input is
long.
Thanks again for any help or suggestions!
Ulla
Ulla (Ulrike) Schat wrote:
> Hi,
>
>> I ran your test program with no problems using jakarta-oro 2.0.8 and
>> JDK's 1.2, 1.3, and 1.4 for Linux. I then downloaded the 2.0.1
>> distribution and tried the same thing with that with the same result.
>
>
> I just re-tested with 2.0.8. and I also have the same problem with my
> original test program.
>
>
>> What Java runtime are you using and on what OS?
>
>
> I am using java verson 1.4.2_03 on Windows 2000.
>
> However, rewriting the old expression "{(\\d+):([^}]*)(?!-})"
> to what you suggested "{(\\d+):([^}]+)(?!-})" did the trick!
> Plus it seems quite fast!
>
>
> Thanks a lot for your help!
> Ulla
>