$em =~ /^(\w[\w|\.]).*@(\w\w).*\.(\w+)$/;
Note that in the [\w|\.] character class, the | (pipe) character matches a literal pipe character and is not an alternation. (I'm not sure if you intended a character match or not.) Also, escaping the . (period) character (\.) in the class is not needed, but does no harm.
Give a man a fish: <%-{-{-{-<
In reply to Re: Counting characters within regexp
by AnomalousMonk
in thread Counting characters within regexp
by Bod
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |