Don't ask to ask, just ask | |
PerlMonks |
Re: Regular Expressionby tobyink (Canon) |
on Jun 27, 2012 at 11:48 UTC ( [id://978626]=note: print w/replies, xml ) | Need Help?? |
The data you posted, does correctly match your regular expression for width. So if it's not working for you, then there's probably something else important in your code that you've neglected to tell us. One possibility is that your input data actually contains trailing whitespace on the Width line. You don't account for leading or trailing whitespace in your regular expression. The Descr regular expression isn't going to match though. Example follows. Don't copy and paste because it may be whitespace-sensitive. Use the "download" link which PerlMonks provides underneath the code...
perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'
In Section
Seekers of Perl Wisdom
|
|