String Manipulation Alternatives to RegEx

From: Tom (Tom_at_discussions.microsoft.com)
Date: 09/28/04


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



Relevant Pages

  • Re: String Manipulation Alternatives to RegEx
    ... Rather then read the entire string into memory, ... If the next line is not the pattern, write the first line, making the next ... > I tried using Regular Expressions to look for patterns and replace the ... > So I am looking for an alternative method as I've been told Regular ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: what is the quickest way to find out whether a string contains another string?
    ... Why would anyone want to use regular expressions to look for a plain ... Regular expressions are a tool for deciding whether a String or ... searching is a trivial degeneration of the problem addressed by regular ... input string into a pattern that matches only itself is the first task. ...
    (comp.lang.java.programmer)
  • Re: ACT scripting
    ... While executing the the script send by you..I am getting the following ... > 1) Assuming the pattern you are looking for is unique in the file, ... > 'string to search ... > Regular Expressions. ...
    (microsoft.public.scripting.vbscript)
  • Re: Pattern Match
    ... Is there any way to get them in one pattern? ... Here's a demo program I use to test out regular expressions. ... quotes if the expression has spaces) and a string to test (again ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Predicting the Future and Kolmogorov Complexity
    ... Predictability is based on the pattern itself. ... addition to the string. ... For any prediction scheme, there are computable strings that show no ... Out of this hole comes a ~2 cm blue marble followed by a red ...
    (talk.origins)