Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: regular expressionby Narveson (Chaplain) |
on Aug 03, 2012 at 14:45 UTC ( [id://985252]=note: print w/replies, xml ) | Need Help?? |
Your regular expression /.*_?(.*)/ starts with .*, which matches any string of any length. The _?(.*) matches the empty string that remains after your first piece has matched everything. So you captured the empty string. When you review the manual, pay special attention to the meaning of the quantifiers * and ?.
In Section
Seekers of Perl Wisdom
|
|