Is there something faster than .|[\r\n] in RegExp ?
-
Like to pass RegexOptions.SingleLine[^] into Regex costructor[^]? I don't know if it is faster but I'd give it a try (If I understand your regex correctly, it's pretty simple but these are strange days for me...). David Never forget: "Stay kul and happy" (I.A.)
David's thoughts / dnhsoftware.org / MyHTMLTidy -
That will just match the first char of the string. So I guess you can just use
string[0]
. xacc-ide 0.0.15 now with C#, MSIL, C, XML, ASP.NET, Nemerle, MyXaml and HLSL coloring - Screenshots -
That will just match the first char of the string. So I guess you can just use
string[0]
. xacc-ide 0.0.15 now with C#, MSIL, C, XML, ASP.NET, Nemerle, MyXaml and HLSL coloring - Screenshots -
I want to match multiple-line comments from /* to */ so I use:
Regex regex = new Regex("/\\*(**.|[\r\n]**)*?\\*/");
ektoras wrote: Regex regex = new Regex("/\\*(.|[\r\n])*?\\*/"); This could be slightly faster. You have a few unnessary constructs.
Regex regex = new Regex("/\\*[.\r\n]*?\\*/");
xacc-ide 0.0.15 now with C#, MSIL, C, XML, ASP.NET, Nemerle, MyXaml and HLSL coloring - Screenshots -
ektoras wrote: Regex regex = new Regex("/\\*(.|[\r\n])*?\\*/"); This could be slightly faster. You have a few unnessary constructs.
Regex regex = new Regex("/\\*[.\r\n]*?\\*/");
xacc-ide 0.0.15 now with C#, MSIL, C, XML, ASP.NET, Nemerle, MyXaml and HLSL coloring - Screenshots