Re: [SMARTY] Escaping the curly braces

From: Date: Fri, 09 Aug 2002 16:15:28 +0000
Subject: Re: [SMARTY] Escaping the curly braces
References: 1 2 3  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-5634@lists.php.net to get a copy of this message
On Friday 09 August 2002 18:03, you wrote: > On Fri, Aug 09, 2002 at 05:29:27PM +0200, David Pavlotzky wrote: > > That isn't possible since it's not a literal but a variable modifier. > > Here's what I'm trying to do: > > > > > > {$some_variable|regex_replace:"/^\d{4}([a-z]|[A-Z]){2}$/":"<replacement>" > >} > > IMHO a workaround would be putting the regex (and maybe the > replacement) in a tpl- or a config-var. I already changed the regex, but it didn't get any pretier: /^\d\d\d\d([a-z]|[A-Z])([a-z]|[A-Z])$/ It will have to do. Still it might not be such a bad idea to implement some sort of escaping mechanism. > > have fun > messju > > > I cannot use {literal} inside a smarty section. I just need to escape the > > curly braces. Maybe I want to much :-) > > > > thanx for your help anyway. > > > > On Friday 09 August 2002 16:57, Sean Chambers wrote: > > > Use the following: > > > > > > {literal} > > > > > > {/literal} > > > > > > All curly braces within those tags will be ignored > > > > > > -----Original Message----- > > > From: David Pavlotzky [mailto:david@djin.com] > > > Sent: Friday, August 09, 2002 10:33 AM > > > To: smarty-general@lists.php.net > > > Subject: [SMARTY] Escaping the curly braces > > > > > > > > > Hi, > > > > > > Is there some way to escape the curly braces {' > > > }' ? I'm trying to > > > use > > > > > > regex_replace in my template but, not surprisingly, smarty barfs on the > > > curly > > > braces that I need in my regexp. It's a regexp to verify dutch postal > > > codes > > > and it looks like this: > > > > > > /^\d{4}([a-z]|[A-Z]){2}$/ > > > > > > thanx for helping me out. > > > > > > David > > > > -- > > Smarty General Mailing List (http://smarty.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.smarty.general (#5634) next »