D 1.0: std.regexp incredibly slow!

Markus Dangl danglm at in.tum.de
Tue Sep 22 08:55:53 PDT 2009


Hi *,

i stumbled on what seems to be a bug in std.regexp: It is incredibly
slow using the following pattern:
RegExp("^\\s+(\\d+)\\s+(\\d+)\\s+\\w+\\s+(\\w+)\\s+\\S+\\s+\\S+\\s+\\S+\\s+\\S+\\s+\\S+\\s+(.*)\r?\n?$")

I don't really get the regexp code, so i can't debug it myself, but i
have a PHP (!!) script that executes the same regexp in milliseconds.

I attached code to test it, can someone please confirm?

Thanks,
Markus

PS: Is there a quick way to fix this or are there bindings for other
RegExp libs that i can use (Linux and Windows required) - i need to fix
my program soon :) atm i'm looking for workarounds (splitting it into
small regexps).
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: slow.d
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20090922/da29ba2c/attachment.ksh>


More information about the Digitalmars-d mailing list