perl -E "say q(found ), $count=()=qq(abcdefab\ncdefa\nbcdef) =~ /a\n?b\n?c/gm, q( [abc] occurences)" found 3 [abc] occurences