Re: RE:regular expressions using not !! by Alex
Alex
Fri May 09 05:43:03 CDT 2008
You can do this using regular expressions, but NOT in a single stage. RE
engines don't ever seem to support that in a single step - presumably
because it would take an inordinate amount of syntax and in practical terms
always reduces to performing multiple regular expression searches. In
essence, your first expression is a pass filter and the second is a reject
filter.
So the approach would be to perform the test for
"[a-z]+[0-9]+"
first and pass all matches. Then you need to test each item from the set of
matches for
"mll[0-9]"
and reject any matches.
<karsagarwal@gmail.com> wrote in message
news:705eeb6d-007e-4477-8420-9b7575a7915c@z24g2000prf.googlegroups.com...
> Hi,
>
> I have a regular expression such as:
>
> "[a-z]+[0-9]+" So this basically includes all alphabeths followed by
> numbers but I do not want "mll" followed by numbers.
>
> I am using this in an if statement. Is it possible to set a pattern
> for something like this maybe by using a ^ or a not ??
>
> Thanks
> SA
>