[OT] searching for a regular expression to match strings

Christoph Höger choeger at cs.tu-berlin.de
Thu Jan 29 16:57:44 UTC 2009


Hi,

anyone knows about a (high-performance) regular expression to match
java-like Strings?
(e.g. "Hi, World \n this is a \"-quoted string.\n")

I have tested 

((\\.)|[^"\\])*

which basically does what I want (although capturing too much escape
sequences). 

The problem is: I've tried jakarta's regexp and java's implementation
and both run into Stack Overflows for input strings with more than 500
characters. That is definitely not acceptable as a hard limit for
tokenizing source code.

Any suggestions?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: Dies ist ein digital signierter Nachrichtenteil
URL: <http://listman.redhat.com/archives/fedora-list/attachments/20090129/81e40a7d/attachment-0001.sig>


More information about the fedora-list mailing list