Tom,
The regular expression doesn't time out, rather, the request is timing
out. You have to change the executionTimeout value in the httpRuntime
element in the web.config file to extend the timeout of the request.
Also, I would seriously consider using something else if you have 2.5
million bytes of text to search through, as using a regular expression is
not the most efficient manner (you have to load the text to be searched on
as a string, and allocating THAT much continuous memory is going to kill
you).
I would look for third party components that can work on a file, or work
on a stream.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"Tom" <To*@discussions.microsoft.com> wrote in message
news:A1**********************************@microsof t.com...
I have string that is 2.5 million bytes long.
I tried using Regular Expressions to look for patterns and replace the
pattern found with a pre-defined text. This works great on some computers
but on some others (win 2K server 1gig of ram) it times out!
So I am looking for an alternative method as I've been told Regular
Expressions are expensive.
Here is my pattern;
white spaces followed by a new line (\n) followed by more spaces plus
a predefined string.
For each occurance, I want to replace this pattern with a predefined
string,
thereby removing all the blank lines, cr lf.
Does anyone know of an alternative method to try?
Can you provide an example?
Thanks
Tom