|
|
| The stupid question is the question not asked | |
| PerlMonks |
Re^3: How to replace on a smooth way?by MidLifeXis (Prior) |
| on Apr 19, 2012 at 14:31 UTC ( #965986=note: print w/ replies, xml ) | Need Help?? |
|
The stuff within the parens is a capture - if you move the § outside of the capturing parenthesis, and then add your required entity to the replacement text, it should do what you need. So, if you have a replacement s/(A\S+)/[$1]/ and want to replace A with something else, you would use s/A(\S+)/[B$1]/ instead, replacing A and B as necessary. A read of perlre, perlrequick, and perlretut may be helpful. I also wonder if HTML::Entities may be a more appropriate solution to the second requirement. --MidLifeXis
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||