Perl-Sensitive Sunglasses | |
PerlMonks |
Regular expression quantifiers and the /gsmx modifiersby davis (Vicar) |
on Jun 16, 2012 at 21:22 UTC ( [id://976599]=perlquestion: print w/replies, xml ) | Need Help?? |
davis has asked for the wisdom of the Perl Monks concerning the following question: *blows dust off perlmonks.org account. I've been away a while, but thought my Perl-fu was up to this rather simple task. I believe I'm suffering from a rather simple misunderstanding of the /x modifier, and of the {} quantifiers. It's also the first time I've used the named capture buffers, but I'm not sure that matters. Here's a complete script which should produce a match, so what have I done wrong?
The example data is slightly contrived, in that the "Alternate Link" lines are optional (and there may be many). Removing the additional 6 lines below the "PV Name" line in the regex makes it work, so have I completely confused the multi-line comment switch? Also, I know this is a slightly ludicrous method to process VG data, but I've been handed a big, big list of "vgdisplay -v" output, and this particular edge case is failing. I've reduced it to this minimal example and my eyes still can't spot what's wrong. What silly mistake am I making? davis
Back to
Seekers of Perl Wisdom
|
|