[prev in list] [next in list] [prev in thread] [next in thread] 

List:       smarty-general
Subject:    [SMARTY] regex_replace modifier
From:       Gabriel Birke <birke () kontor4 ! de>
Date:       2003-12-01 12:26:01
[Download RAW message or body]

After some fiddling with the regex_replace modifier I found out that 
the "$n" backreference doesn't work (Smarty 2.5), only the "\\n" 
backreference. Maybe this should be mentioned in the manual to avoid 
further wasting of time when others try to use this modifier.

To display only a filename, without the path:

{$entry.file|regex_replace:"'.*/([^/]+)$'":"$1"}

doesn't work

{$entry.file|regex_replace:"'.*/([^/]+)$'":"\\1"}

does.

With best regards

Gabriel Birke

-- 
KONTOR4_Neue Medien
Nelkenstrasse 3
31515 Wunstorf
Germany
Phone: +49 5031-955244
Fax: +49 5031-955231
mailto:birke@kontor4.de
http://www.kontor4.de

-- 
Smarty General Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic