« Return to Thread: Certain non-zero-length non-matching regexes run forever on Saxon

Re: Certain non-zero-length non-matching regexes run forever on Saxon

by Owen Rees :: Rate this Message:

Reply to Author | View in Thread

--On Tuesday, January 23, 2007 17:18:56 +0100 Abel Braaksma wrote:

> I am
> aware of the fact that Saxon relies havily on Sun's Java regex engine,
> but I also know that it does a translation beforehand.

In this case, the problem is in the Java regex engine but according to
<http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6393051> and the
related entries in the Java bug database some matches have exponential time
complexity, at least with the algorithms Java uses so this is not a bug
they intend to fix. (I don't know if there are other algorithms that can
handle such cases.)

An alternative for the particular case that seems not to cause the problem
is:

<xsl:variable name="regex">("[^"]*")+</xsl:variable>

--
Owen Rees
Hewlett Packard Laboratories, Bristol, UK


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
saxon-help mailing list
saxon-help@...
https://lists.sourceforge.net/lists/listinfo/saxon-help

 « Return to Thread: Certain non-zero-length non-matching regexes run forever on Saxon