Re: String Manipulation Alternatives to RegEx
From: Nicholas Paldino [.NET/C# MVP] (mvp_at_spam.guard.caspershouse.com)
Date: 09/28/04
- Next message: Ignacio Machin \( .NET/ C# MVP \): "Re: c# OpenFileDialog problem"
- Previous message: Josema: "Re: Classes concepts"
- In reply to: Tom: "String Manipulation Alternatives to RegEx"
- Next in thread: Tom: "Re: String Manipulation Alternatives to RegEx"
- Reply: Tom: "Re: String Manipulation Alternatives to RegEx"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 28 Sep 2004 08:38:41 -0400
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]
- mvp@spam.guard.caspershouse.com
"Tom" <Tom@discussions.microsoft.com> wrote in message
news:A18DE2D1-BEC6-4AE3-9E16-DB9844F2CCD9@microsoft.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
>
- Next message: Ignacio Machin \( .NET/ C# MVP \): "Re: c# OpenFileDialog problem"
- Previous message: Josema: "Re: Classes concepts"
- In reply to: Tom: "String Manipulation Alternatives to RegEx"
- Next in thread: Tom: "Re: String Manipulation Alternatives to RegEx"
- Reply: Tom: "Re: String Manipulation Alternatives to RegEx"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|