[Templates] using variable in replace

Randal L. Schwartz merlyn@stonehenge.com
12 Jan 2007 12:50:00 -0800


>>>>> "James" == James L <perlwle@yahoo.com> writes:

James> hello,
James> I am trying to replace a variable using

James> [% field | replace("\b${word}\b", "<b>${word}</b>") %]

Does the field variable contain any backspaces?  If not, that's not gonna
work, ever.

Hint:  \b is a backspace.
Bigger hint: you might want \\b instead.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!