Actually what your regex is trying to match is spaces tabs or literal '.' characters. In a character class the '.' char matches a literal '.' Outside it matches *anything* including spaces but excluding only newlines. It will match newlines as well with a /s modifier.
$_='1222222222222222222223333333333333333333344444'; /(.)(.{20})(.{20})(.{5})/; print "$1 $2 $3 $4"; # '.' will match a space print " " =~ /./ ? "\nmatch space" : "\nno match space"; # this is how you make . match everyting with a /s print "\n" =~ /./ ? "\nmatch" : "\nno match"; print "\n" =~ /./s ? "\nmatch" : "\nno match";
Hope this helps
cheers
tachyon
s&&rsenoyhcatreve&&&s&n\w+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print
In reply to Re: Regex Matching
by tachyon
in thread Regex Matching
by kbradford
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |