xref: /PHP-8.2/ext/pcre/tests/preg_replace.phpt (revision ded3d984)
1--TEST--
2preg_replace()
3--FILE--
4<?php
5
6var_dump(preg_replace('{{\D+}}', 'x', '{abcd}'));
7var_dump(preg_replace('{{\D+}}', 'ddd', 'abcd'));
8
9var_dump(preg_replace('/(ab)(c)(d)(e)(f)(g)(h)(i)(j)(k)/', 'a${1}2$103', 'zabcdefghijkl'));
10
11?>
12--EXPECT--
13string(1) "x"
14string(4) "abcd"
15string(8) "zaab2k3l"
16