my $html="\nt1\n<\/table>\n
\nt2\n<\/table>\n" $html =~ m/
(.*?)
/; # Failed, since 'The period '.' matches any character but ``\n'' $html =~ m/(.*?)
/s; # SUCCESS, since 's modifier (//s): Treat string as a single long # line. '.' matches any character, even "\n"' $html =~ m/[a-zA-Z0-9 \r\n<>"!-=]*?
# SUCCESS - Emulating '.' with defining a own character class, # containing 'any' characters (or a subset in this example) including # '\n' # NO s modifier (//s) needed $html =~ m/[.\n]*?
; # Same as above, but using '.' instead of explicitly listing all # characters ... # Failed, WHY? Why is '.' not allowed within a character class?