regex_replace modifier
| From: | Gabriel Birke | Date: | Mon, 01 Dec 2003 12:26:01 +0000 |
| Subject: | regex_replace modifier | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-10606@lists.php.net to get a copy of this message | ||
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