Home
last modified time | relevance | path

Searched refs:preg_replace (Results 1 – 25 of 70) sorted by relevance

123

/php-src/ext/pcre/tests/
H A Dpreg_replace_error1.phpt2 Test preg_replace() function : error - bad regular expressions
9 * Testing how preg_replace reacts to being passed the wrong type of regex argument
26 var_dump(preg_replace($regex_value, $replace, $subject));
30 var_dump(preg_replace($regex_value, $replace, $subject));
37 Warning: preg_replace(): Delimiter must not be alphanumeric, backslash, or NUL byte in %spreg_repla…
40 Warning: preg_replace(): No ending delimiter '/' found in %spreg_replace_error1.php on line %d
43 Warning: preg_replace(): Unknown modifier '/' in %spreg_replace_error1.php on line %d
46 Warning: preg_replace(): Unknown modifier 'F' in %spreg_replace_error1.php on line %d
50 preg_replace(): Argument #1 ($pattern) must be of type array|string, stdClass given
H A Dbug66121.phpt6 var_dump(preg_replace('/(?<!ක)/u', '*', 'ක'));
7 var_dump(preg_replace('/(?<!ක)/u', '*', 'ම'));
9 var_dump(preg_replace('/(?<!k)/u', '*', 'k'));
10 var_dump(preg_replace('/(?<!k)/u', '*', 'm'));
15 var_dump(preg_replace('/(?<!ක)/u', '*', "\xFCක"));
16 var_dump(preg_replace('/(?<!ක)/u', '*', "ක\xFC"));
H A Dbug53823.phpt2 Bug #53823 - preg_replace: * qualifier on unicode replace garbles the string
5 var_dump(preg_replace('/[^\pL\pM]*/iu', '', 'áéíóú'));
7 var_dump(preg_replace('/[^\pL\pM]*/iu', '', "\xFCáéíóú"));
8 var_dump(preg_replace('/[^\pL\pM]*/iu', '', "áéíóú\xFC"));
H A Dpreg_replace.phpt2 preg_replace()
6 var_dump(preg_replace('{{\D+}}', 'x', '{abcd}'));
7 var_dump(preg_replace('{{\D+}}', 'ddd', 'abcd'));
9 var_dump(preg_replace('/(ab)(c)(d)(e)(f)(g)(h)(i)(j)(k)/', 'a${1}2$103', 'zabcdefghijkl'));
H A Dpreg_replace2.phpt2 preg_replace()
12 var_dump(preg_replace(array('/\da(.)/ui', '@..@'), '$1', '12Abc'));
13 var_dump(preg_replace(array('/\da(.)/ui', '@(.)@'), '$1', array('x','a2aA', '1av2Ab')));
16 var_dump(preg_replace(array('/[\w]+/'), array('$'), array('xyz', 'bdbd')));
17 var_dump(preg_replace(array('/\s+/', '~[b-d]~'), array('$'), array('x y', 'bd bc')));
H A D002.phpt14 var_dump(preg_replace('/(.)/', '${1}${1', 'abc'));
15 var_dump(preg_replace('/.++\d*+[/', 'for ($', 'abc'));
16 var_dump(preg_replace('/(.)/e', 'for ($', 'abc'));
24 Warning: preg_replace(): Compilation failed: missing terminating ] for character class at offset 8 …
27 Warning: preg_replace(): Unknown modifier 'e' in %s on line %d
H A Dpreg_replace_error2.phpt2 Test preg_replace() function : error conditions - wrong arg types
9 * Testing how preg_replace reacts to being passed the wrong type of replacement argument
16 var_dump(preg_replace($regex, $value, $subject));
23 var_dump(preg_replace($regex, $value, $subject));
30 preg_replace(): Argument #1 ($pattern) must be of type array when argument #2 ($replacement) is an …
31 preg_replace(): Argument #2 ($replacement) must be of type array|string, stdClass given
H A Dpcre_count.phpt2 preg_replace() fifth parameter - count
9 var_dump(preg_replace($regex, 'xxxx', $string, -1, $count));
16 var_dump(preg_replace($regex, 'xxxx', $string, -1, $count));
23 var_dump(preg_replace($regex, '...', $string, -1, $count));
29 var_dump(preg_replace($regex, '...', $string, -1));
H A Dpreg_replace_basic.phpt2 Test preg_replace() function : basic functionality
10 var_dump(preg_replace('<- This is a string$>', 'This shouldn\'t work', $string)); //tries to find '…
11 var_dump(preg_replace('<[0-35-9]>', '4', $string)); //finds any number that's not 4 and replaces it…
12 var_dump(preg_replace('<\b[hH]\w{2,4}>', 'Bonjour', $string)); //finds h or H at the beginning of a…
13 var_dump(preg_replace('<(\w)\s*-\s*(\w)>', '\\1. \\2', $string)); //finds dashes with an indefinite…
14 var_dump(preg_replace('<(^[a-z]\w+)@(\w+)\.(\w+)\.([a-z]{2,}$)>', '\\1 at \\2 dot \\3 dot \\4', 'jo…
H A Dpreg_replace_edit_basic.phpt2 Test preg_replace() function : basic
8 var_dump(preg_replace('<- This is a string$>',
11 var_dump(preg_replace('<[0-35-9]>',
17 var_dump(preg_replace('<\b[hH]\w{2,4}>',
20 var_dump(preg_replace('<(\w)\s*-\s*(\w)>',
23 var_dump(preg_replace('<(^[a-z]\w+)@(\w+)\.(\w+)\.([a-z]{2,}$)>',
H A Dbug21732.phpt2 Bug #21732 (preg_replace() segfaults with invalid parameters)
13 var_dump(preg_replace('', array(), ''));
20 preg_replace(): Argument #1 ($pattern) must be of type array when argument #2 ($replacement) is an …
H A D006.phpt2 preg_replace() with array of failing regular expressions
10 $result = preg_replace(array('#\[(right)\](((?R)|[^[]+?|\[)*)\[/\\1\]#siU', '#\[(right)\](((?R)|[^[…
14 $result = preg_replace('#\[(right)\](((?R)|[^[]+?|\[)*)\[/\\1\]#siU', '', $text);
H A Dbug37800.phpt2 Bug #37800 (preg_replace() limit parameter odd behaviour)
11 $s_output = preg_replace($s_search, $s_replace, $s_string, $i_limit,
18 $s_output = preg_replace($s_search, $s_replace, $s_string, $i_limit,
H A Dpreg_replace_variation1.phpt2 Test preg_replace() function : variation both arguments are arrays
9 * Testing preg_replace when the regex and the replacement are both arrays.
12 $new_string = preg_replace(array('/\b\w{1}s/', '/(\d{1})-(\d{1})/', '/[\(!\)]/'), array('test', '$1…
H A Dbug79188.phpt2 Bug #79188: Memory corruption in preg_replace/preg_replace_callback and unicode
6 var_dump(preg_replace("//u", "", "a" . str_repeat("\u{1f612}", 10)));
H A Dbug79363.phpt6 var_dump(preg_replace('/[\p{L}\p{Arabic}]/', '0', $str));
7 var_dump(preg_replace('/[^\p{L}\p{Arabic}]/', '0', $str));
H A Dbug21758.phpt8 $s = 'preg_replace() is broken';
26 string(25) "preg_replace() is working"
H A Dinvalid_utf8.phpt2 preg_replace() and invalid UTF8
13 $result = preg_replace("#(&\#x*)([0-9A-F]+);*#iu","$1$2;",$string);
H A Dbug81243.phpt2 Bug #81243 (Too much memory is allocated for preg_replace())
7 $replaced = preg_replace('/\s/', '-', $test_string);
H A Dgh15205_2.phpt8 preg_replace('/pattern/', 'replace', 'subject');
20 preg_replace('/pattern/', 'replace', 'subject');
H A Dbug41148.phpt43 $letexte = preg_replace($cherche1, $remplace1, $letexte);
44 $letexte = preg_replace("@^ <br />@S", "", $letexte);
/php-src/scripts/dev/
H A Dbless_tests.php65 $out = preg_replace('/in (\/|[A-Z]:\\\\)\S+ on line \d+/m', 'in %s on line %d', $out);
66 $out = preg_replace('/in (\/|[A-Z]:\\\\)\S+:\d+/m', 'in %s:%d', $out);
67 $out = preg_replace('/\{closure:(\/|[A-Z]:\\\\)\S+:\d+\}/', '{closure:%s:%d}', $out);
68 $out = preg_replace('/object\(([A-Za-z0-9]*)\)#\d+/', 'object($1)#%d', $out);
69 $out = preg_replace('/^#(\d+) (\/|[A-Z]:\\\\)\S+\(\d+\):/m', '#$1 %s(%d):', $out);
70 $out = preg_replace('/Resource id #\d+/', 'Resource id #%d', $out);
71 $out = preg_replace('/resource\(\d+\) of type/', 'resource(%d) of type', $out);
72 $out = preg_replace(
76 $out = preg_replace('/string\(\d+\) "([^"]*%d)/', 'string(%d) "$1', $out);
/php-src/ext/standard/tests/streams/
H A Dbug61115.phpt11 preg_replace('', function() {}, $resourceFileTemp);
17 preg_replace(): Argument #2 ($replacement) must be of type array|string, Closure given
/php-src/ext/mbstring/tests/
H A Dphp_gr_jp_dev_884-2.phpt12 var_dump(preg_replace("/C?$/", "Z", "ABC"));
14 var_dump(preg_replace("/C*$/", "Z", "ABC"));
/php-src/ext/opcache/tests/
H A Dblacklist-win32.phpt17 $conf[3] = preg_replace("!^\\Q".__DIR__."\\E!", "__DIR__", $conf[3]);
18 $conf[4] = preg_replace("!^\\Q".__DIR__."\\E!", "__DIR__", $conf[4]);

Completed in 24 milliseconds

123