Read the Perl perlretut, especially the part on character classes. You probably want a common class like \w.
Your first regexp matches everything up until the second one matches.
It's a good use of your time to stop what you are doing, take 30 minutes, and read and understand the tutorial !
Update: links to docs
In reply to Re: need help with explaining the output
by 1nickt
in thread need help with explaining the output
by perlynewby
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |