RE's and grep

Richard Chonak rac at gabrielmass.com
Tue Sep 2 21:08:37 EDT 2003


Kevin D. Clark wrote:

> Or do you mean 'a' *and* 'e' *and* 'i'.  If so, I'd write:
> 
>         perl -ne 'print if (!/a/ && !/e/ && !/i/)' file.dict
> 

Or do you mean
    perl -n -e 'print if !(/a/ && /e/ && /i/)' file.dict

Both versions will exclude the word "Cambridge" and allow
"Boston", but Kevin's will also filter out "Berkeley".

--RC




More information about the Discuss mailing list