Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Substituting in the substitution!by Mondongo (Beadle) |
on May 06, 2004 at 15:32 UTC ( [id://351163]=perlquestion: print w/replies, xml ) | Need Help?? |
Mondongo has asked for the wisdom of the Perl Monks concerning the following question:
I have a string like this [ABC AB AB12/83] and I do s|\[([AZ_]+)\s([AZ_]+)\s([AZ_]+)\]|:$1_$2_$3|g so I end up with ABC_AB_AB12/83 I would like to end up with ABC_AB_AB12_83 changing the "/" to "_" can it be done? maybe with s|\[([AZ_]+)\s([AZ_]+)\s([AZ_]+)\]|:$1_$2_&do_the_change($3)|ge or something more "inline"... ? thx to all!
Back to
Seekers of Perl Wisdom
|
|