I have a situation where my regular expressions compile extremely slowly on Windows Server 2008. I wrote a small console application to highlight this issue. The app gener
I found a solution, given not the correct one, but perfect in my case. For some reason if I leave out the RegexOptions.Compiled flag, the Regex is much, much faster. I even managed to execute the Regex on 100 long phrases in under 65 milliseconds on the 2008 server.
This must be a bug in the .net lib as the uncompiled version is supposed to be much slower than the compiled version. Either way, under 1 millisecond per check is very much acceptable for me :)