Sean Moore sent me a solution (off list):

�^(?!([Cc][Ss][Ii][Cc])).*mail

(and �^(?!(Csic)).*mail works also, within Nedit).

I'm actually trying to do the search in a TWiki, and apparently TWiki 
doesn't recognize the ?! syntax (or at least, it doesn't work).

Anyway, thought I'd post this "for the record".  

PS: The ?! syntax is described on the perlre man page as:

"A zero-width negative look-ahead assertion.  For example  
"/foo(?!bar)/" matches any occurrence of "foo" that isn't followed by  
"bar".  Note however that look-ahead and look-behind are NOT the same 
thing.  You cannot use this for look-behind." 

And there is more that you should probably read if you plan to use this.

Randy Kramer

On Friday 27 September 2002 04:26 pm, Randy Kramer wrote:
> I want a regular expression that will find every line (in the sample
>  data below) that includes "mail" but does not start with "Csic". 
> (I'm doing this in the "find" dialog of Nedit 5.2 (which is the
> "current" version in Mandrake 8.2).)
>
> I've tried REs like the following:
>
> ^[^(Csic)].*mail
> ^[^Csic].*mail
> ^[^C][^s][^i][^c].*mail
>

Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com

Reply via email to