OT: simple regex question

Dario Lesca d.lesca at solinos.it
Mon Apr 23 09:41:43 UTC 2007


Hi, how to found into string 2 or more word, only if are all present?

% echo "aa bb cc dd"|egrep -q '(bb|dd)' && echo found

This command show "found" if bb OR dd are in string.
But if I want show "found" only if bb AND dd are present into string.

What egrep (or sed) command I must use?

Many thanks for your reply!

-- 
Dario Lesca <d.lesca at solinos.it>




More information about the fedora-list mailing list