[PLUG] Regex question

Scott Van Hoosen svanhoosen at yahoo.com
Fri Sep 30 16:00:41 UTC 2005


I'm trying to use perl and a regular expression to find all instances
of "Fred" in a file except for "Fred Flintstone" and "Fred Mertz".
Here's the closest I found, but doesn't quite work:

  /Fred [^(Mertz|Flintstone)]/

It only compares the first letters of Mertz and Flintstone, so it also
filters out "Fred Magoo" and "Fred Meyer". How can I negate a string
rather than a single character?

-Scott


		
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com



More information about the PLUG mailing list