Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
but this turns Cat into <a href=x>cat</a> that is, I lose the capitilization of the term. Thank you for sharing of your wisdom.$term=cat; $newterm="<a href=x>$term</a>"; $text=~s/(\W)$term(\W)/\1$newterm\2/i;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: substitution preserving capitilization
by joealba (Hermit) on Dec 17, 2002 at 18:47 UTC | |
|
Re: substitution preserving capitilization
by jdporter (Paladin) on Dec 17, 2002 at 18:47 UTC | |
|
Re: substitution preserving capitilization
by Enlil (Parson) on Dec 17, 2002 at 18:49 UTC |