>echo 1b22a3d3ccccccccccccccc | perl -nle"/a/&&/b/&&/c/&&/d/ and print 'Matched: ', pack '(a1)4', m[([abcd])]g" Matched: badc