Read perlre and then compare /./ against /.?/. The question marks make the dot optional.
Most likely, you want something like the following:
/^....p.$/
Note the anchors ^ and $ (or alternatively, \A and \z). I've also removed the /i modifier, because you seem want to match a lower-case p only.
In reply to Re: Perl RegEx doubt
by Corion
in thread Perl RegEx doubt
by swissknife
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |