Re: regex with nots in it

From: Ben Holness (usenet_at_bens-house.org.uk)
Date: 10/06/03


Date: Mon, 06 Oct 2003 13:40:28 +0100


>> doesn't do what I want :( perlre suggests that it's easier to have it as
>> two regular expressions, which is what I was trying to avoid.
>
>
> Why? It's a perfectly valid suggestion.

The system I have built checks messages for particular content. The
content is defined in a database, so if I need more than one regex, I need
to implement some slightly more clever code than just getting the regex
from the db and matching :)

The suggestions from yourself and Anno are what I needed though;

/Perl(?!.*PHP)/ does exactly what I need :)

Thanks,

Ben



Relevant Pages

  • Re: " umber" usage
    ... Prateek wrote: ... I would like to match the string: ... The regex i built does not work: ...
    (comp.lang.awk)
  • Re: " umber" usage
    ... I would like to match the string: ... The regex i built does not work: ... but that'd also match an empty record which probably isn't what the OP wanted since the RE he tried to write would enforce the presence of 1 or more characters. ...
    (comp.lang.awk)
  • Re: Downloading unix text files, convert to non-unix?
    ... to phrase it in the same way you did. ... Regex is foreign to me. ... code to avoid creating instances of that. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: How to avoid this greedy match?
    ... How to avoid this greedy match? ... I have a trouble when composing a regex. ... Make Yahoo your home page. ...
    (perl.beginners)
  • Re: " umber" usage
    ... I would like to match the string: ... The regex i built does not work: ... Shell Scripting Recipes: | My code in this post, if any, ...
    (comp.lang.awk)