String Manipulation Alternatives to RegEx
From: Tom (Tom_at_discussions.microsoft.com)
Date: 09/28/04
- Next message: Razzie: "Inherit from IDisposable - when?"
- Previous message: Jon Skeet [C# MVP]: "Re: How to find out a files encoding?"
- Next in thread: Nicholas Paldino [.NET/C# MVP]: "Re: String Manipulation Alternatives to RegEx"
- Reply: Nicholas Paldino [.NET/C# MVP]: "Re: String Manipulation Alternatives to RegEx"
- Reply: Niki Estner: "Re: String Manipulation Alternatives to RegEx"
- Reply: Jay B. Harlow [MVP - Outlook]: "Re: String Manipulation Alternatives to RegEx"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 28 Sep 2004 04:53:02 -0700
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: Razzie: "Inherit from IDisposable - when?"
- Previous message: Jon Skeet [C# MVP]: "Re: How to find out a files encoding?"
- Next in thread: Nicholas Paldino [.NET/C# MVP]: "Re: String Manipulation Alternatives to RegEx"
- Reply: Nicholas Paldino [.NET/C# MVP]: "Re: String Manipulation Alternatives to RegEx"
- Reply: Niki Estner: "Re: String Manipulation Alternatives to RegEx"
- Reply: Jay B. Harlow [MVP - Outlook]: "Re: String Manipulation Alternatives to RegEx"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|