Thanks!
I tried that - no luck. I think my TT engine is veryyyyyyyyyy old!! Like 10yrs 
old.
So, I don't believe that filter is available to me. :-(

--> Is there a way to use regex's to remove all non-utf8 chars from  string, 
from a template perspective?

Thanks

--- On Wed, 8/8/12, Randal L. Schwartz <mer...@stonehenge.com> wrote:

From: Randal L. Schwartz <mer...@stonehenge.com>
Subject: Re: [Templates] How would i convert this regex using TT replace?
To: "Summer" <crazysummer2...@yahoo.com>
Cc: templates@template-toolkit.org
Date: Wednesday, August 8, 2012, 5:58 AM

>>>>> "Summer" == Summer  <crazysummer2...@yahoo.com> writes:

Summer> Hello,
Summer> I have this in javascript, but having issue converting it to be able to 
use with template toolkit replace method.

Summer> js way:
Summer> replace(/(\r\n|\n|\r)/gm,"<br />");

Summer> template toolkit way?

Use the built-in FILTER html_line_break:

[% some_value FILTER html_line_break %]

perldoc Template::Manual::Filters for details

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<mer...@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.posterous.com/ for Smalltalk discussion
_______________________________________________
templates mailing list
templates@template-toolkit.org
http://mail.template-toolkit.org/mailman/listinfo/templates

Reply via email to