cat file.txt | perl -ne '{chomp; ($a, $b) = split/\s+/; $s = "$a $b"; next if($s !~ /^\w+\'?\w+?\s+\w+\'?\w+?$/); print "$_\n"}' | wc -l #### bash: syntax error near unexpected token `)'