XP is just a number | |
PerlMonks |
Re^2: How to substitute something from only between two specified charecters (sub_question)by ww (Archbishop) |
on Jun 29, 2011 at 13:45 UTC ( [id://911972]=note: print w/replies, xml ) | Need Help?? |
OP can probably extrapolate, and maybe that's why the parent stops just short of actually answering the original question: how to remove spaces, but only in the location field -- or learn from some other replies.
But just in case the assumption above is wrong, assign $2 to a named var ($second maybe) and remove spaces:
BUT that's not really the point of this post; rather (perhaps because /me is suffering brain-freeze, why the heck is the second capture ((.*\S)) a-greedy-anything followed by anything-not-whitespace working? Y::R::E isn't helping this morning; neither is a recheck of (some obvious parts of) Mastering Regular Expressions And in case my brain-freeze isn't clear, that chill is telling me that s+(.*\S)\s+(\S+) should capture the location-field and everything else up to the last space, before "HA". That's obviously wrong, but why? Can someone, please, provide a the meat for a slap my forehead, grunt "Duh!" moment?
In Section
Seekers of Perl Wisdom
|
|