![]() |
|
Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: conditional statement in substitution expressionby jethro (Monsignor) |
on Aug 04, 2009 at 16:52 UTC ( #785828=note: print w/replies, xml ) | Need Help?? |
You might split the regex into two. In the first the regex should have the first ([^\*]+) changed to ([^\*]*_[^\*]*). In regex two the second ([^\*]+) is changed. Note this will also substitute if BOTH substrings contain underscores, but you could use ([^\*_]+) to prevent that.
In Section
Seekers of Perl Wisdom
|
|