Get Smarty


Smarty Icon

You may use the Smarty logo according to the trademark notice.

Smarty Template Engine Smarty Template Engine

For sponsorship, advertising, news or other inquiries, contact us at:

Sites Using Smarty

Buy cheap glasses from and save up to 80%.

Where to buy prescription glasses? is your best choice!

Visit for cheap soccer cleats, sneakers and Soccer Jerseys updates



Posición del Parametro Tipo requerido Default Descripción
1 string Si n/a Esta es la expresión regular a ser substituida.
2 string Si n/a Esta es la cadena que sustituira a la expresión regular.

Localiza una expresión regular y la remplaza en la variable. Use la sintaxis para preg_replace() del manual de PHP.

Example 5.14. regex_replace


$smarty->assign('articleTitle', "Infertility unlikely to\nbe passed on, experts say.");



Donde index.tpl es:

{* replace each carriage return, tab and new line with a space *}

{$articleTitle|regex_replace:"/[\r\t\n]/":" "}


Esta es la salida:

Infertility unlikely to
be passed on, experts say.
Infertility unlikely to be passed on, experts say.


Vea también replace y escape.

No comments for this page.