Il giorno lun, 23/04/2007 alle 11.05 +0100, Matt Davey ha scritto: > echo "aa bb cc dd" | perl -pe 'exit(!(/(?=.*bb)(?=.*aa)/));' Ok for perl, but I must match the word 'aa' and (for example) 'bb', someone like this: /(\saa\s)&(\sbb\s)/ ..... Your example found also "aa xxbb cc dd" and is not what I want... however ... Many thanks -- Dario Lesca <d.lesca@xxxxxxxxxx>