Return Data Regex Doesn't Isolate - Yikes

From: Garibaldi (ty_92648)
Date: 04/11/04


Date: Sun, 11 Apr 2004 09:12:45 -0700

Folks,

I'm having a bad regex day and can sure use your help, please..

I have a Regex expression that works fine. It's purpose is to isolate all
data from the start of a string begining with 200~ to the end of the string
but before the start of the next 200~. Here's the regex expression and test
data:

(?ms)^200~(.*?)(?=^200~)

Here's some test data

00000000000000000000
200~11111111111111111
22222222222222222222222222222
3333333333333
200~444444444444444444444444
555555555555555555555555555555555
66666666
200~777777777777777777
888888888888

The regex will return 200~ plus all ones, twos, threes as a group then 200~
plus all fours, fives, sixes as a group

Problem
---------
Now I need to do the reverse. I need to return all the data the preceding
regex doesn't return. IOW, I need to return all the zeros and 200~ plus all
the sevens and all the eights as a group. I want to execute "NOT
(?ms)^200~(.*?)(?=^200~)"

Sure could use a pointer to the correct starting point or any suggestion
that will help me reach my goal.

Thanks in advance

ty_92648 AT hotmail.com



Relevant Pages

  • Re: best design for parse
    ... Dim _regex As New ... Although the application does not exactly know before hand what format the ... format and identifier I can use regex,replace to normalize the date. ... relevant regex expression to be used for date normalization later in part ...
    (microsoft.public.dotnet.languages.vb)
  • Re: need help with regex
    ... >i have a regex expression: ... The problem with your regex is that the first ".*" originally matches ... backtrack in order to match the rest of the pattern--but it only ... You do need to add a quantifier to the subexpression, ...
    (comp.lang.java.programmer)
  • Re: RegEx problem
    ... A quick test with a loop and two timestamps will show you why! ... Regex can do beautiful things, but isn't the best tool for every problem. ... I'm not sure if a int.TryParse would impact the loop you tried enough to make is slower than a regex though, my guess is that it's still faster than a regex. ... I think it must be the last part of my regex expression. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: best design for parse
    ... 1.copy the date format string regex string holder and then derive the ... relevant regex expression to be used for date normalization later in part 2: ...
    (microsoft.public.dotnet.languages.vb)
  • Re: RegEx problem
    ... "Jesse Houwing" wrote: ... I think it must be the last part of my regex expression. ... repeat optional group if possible ...
    (microsoft.public.dotnet.languages.csharp)