Compiled Option In RegEx

There seems to be a bug in .NET RegEx for Windows Vista 64 when using RegexOptions.Compiled option.

Regex rex = new Regex(pattern, RegexOptions.Compiled);

If the pattern is a really big string then the actual compilation will get stuck in an infinite loop. I tried with a RegEx that took 20 ms to compile on Windows XP 32 bit, that froze the entire program on Vista 64 bit. I killed the process after 5+ minutes. It had then consumed 300 mb of memory.

Removing the Compiled option made the it run as usual with no delay. It did not happen on Vista 32 bit.

Tried this in framework 2.0, 3.0 and 3.5 with same results.

0 kommentarer:

Post a Comment