Or if you only want one single blank,
m/ ?<result>
See perlretut for an introduction to regular expressions.
Update: as SuicideJunkie++ pointed out, the leading \s* or ? are pretty pointless unless you either anchor the regex or look at the match variables after the match.
In reply to Re: matching white spaces in perl
by moritz
in thread matching white spaces in perl
by anand_perl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |