in reply to
global string replace
Use a look-ahead assertion. It looks ahead, but doesn't advance the position:
s/(^|\*)X(?=\*|$)/$1$NEW/g # ~~~
[download]
map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
Comment on
Re: global string replace
Select
or
Download
Code
In Section
Seekers of Perl Wisdom