regex_replace

1.0 1.1 1.2 1.3

Replaces the search string by the replace string using regular expressions

<?php
regex_replace(string $value, string $search, string $replace)

Note that if you want to use backreferences, use \$1 instead of $1, \$2 for $2 and so on, otherwise Dwoo will replace the $1 as if it was a variable.

Examples

Example #1

index.tpl
{regex_replace "abcdABCD" "/([a-z])/" "\$1*"}

The above example will output:

a*b*c*d*ABCD