Re: Performance problem with regex

"Matthias L. Jugel" <[email protected]> Wed, 26 Mar 2003 14:35:46 +0100
Newsgroups gmane.comp.jakarta.oro.user
Message-ID <[email protected]>
Hi,

in the meantime I have mailed to Jeffrey Friedl and just got back a 
changed regex that runs a hundred times faster than my original version.

    "\\{([^:}]+)(?::([^\\}]*))?\\}(.*?)\\{(\\1)\\}"

Thanks for the help.

Leo.

On Mittwoch, März 26, 2003, at 02:24  Uhr, <[email protected]> wrote:

> Hi Matthias,
>
> Try the following. Based on the sample you provided, it seemed to 
> produce
> the results which are consistant the original regex. I only tested 
> this with
> java.util.regex.
>
> String regex = "\\{(\\w\\w*):?(?:\\w*?)\\}(?:.*?)\\{(\\1)\\}";
>
--
Matthias L. Jugel -- [email protected]
Telephone +49 30 6392 1822, Fax +49 30 6392 1805
There are two kinds of fool, on says "This is old and there-
fore good", and one says "This is new and therefore better".