use strict; use warnings; my @strings = ( q {Only literal \t's, \n's etc. here}, qq{There's a real\nnewline in this}, qq{A real\ttab\tdelimited\tstring}, ); my $rxWS = qr{[\r\n\t\f]}; foreach my $string ( @strings ) { print qq{$string\n}; print $string =~ $rxWS ? qq{Match found\n\n} : qq{No match\n\n} } #### Only literal \t's, \n's etc. here No match There's a real newline in this Match found A real tab delimited string Match found