diff options
| author | Peter Kokot <peterkokot@gmail.com> | 2018-10-14 15:37:22 +0200 |
|---|---|---|
| committer | Peter Kokot <peterkokot@gmail.com> | 2018-10-14 19:43:12 +0200 |
| commit | 7af945e271d042a4991c9510f78b6ff7ac43ac34 (patch) | |
| tree | 31d3b7a69f017cd532c5fe31ce1664d426384f82 /ext/pcre/tests/preg_replace_edit_basic.phpt | |
| parent | afd534f1634e9a5d631afac39a9c9b09b1ba8b33 (diff) | |
| download | php-git-7af945e271d042a4991c9510f78b6ff7ac43ac34.tar.gz | |
Trim trailing whitespace in *.phpt
Diffstat (limited to 'ext/pcre/tests/preg_replace_edit_basic.phpt')
| -rw-r--r-- | ext/pcre/tests/preg_replace_edit_basic.phpt | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/ext/pcre/tests/preg_replace_edit_basic.phpt b/ext/pcre/tests/preg_replace_edit_basic.phpt index 556b48b8c1..cd9297684d 100644 --- a/ext/pcre/tests/preg_replace_edit_basic.phpt +++ b/ext/pcre/tests/preg_replace_edit_basic.phpt @@ -1,11 +1,11 @@ --TEST-- -Test preg_replace() function : basic +Test preg_replace() function : basic --FILE-- <?php /* Prototype : proto string preg_replace(mixed regex, mixed replace, mixed subject [, int limit [, count]]) - * Description: Perform Perl-style regular expression replacement. + * Description: Perform Perl-style regular expression replacement. * Source code: ext/pcre/php_pcre.c - * Alias to functions: + * Alias to functions: */ $string = '123456789 - Hello, world - This is a string.'; @@ -14,7 +14,7 @@ var_dump($string); var_dump(preg_replace('<- This is a string$>', 'This shouldn\'t work', $string)); //tries to find '- This is a string' at the end of a string but can't so replaces nothing and prints the unchanged $string. -var_dump(preg_replace('<[0-35-9]>', +var_dump(preg_replace('<[0-35-9]>', '4', $string, //finds any number that's not 4 and replaces it with a 4 '5', $count)); //limits to 5 replacements returns 444444789 var_dump($count); //counts the number of replacements made (5) @@ -26,7 +26,7 @@ var_dump(preg_replace('<\b[hH]\w{2,4}>', var_dump(preg_replace('<(\w)\s*-\s*(\w)>', '\\1. \\2', $string)); //finds dashes with an indefinite amount of whitespace around them and replaces them with a full stop precedeby no spaces and followed by one space -var_dump(preg_replace('<(^[a-z]\w+)@(\w+)\.(\w+)\.([a-z]{2,}$)>', +var_dump(preg_replace('<(^[a-z]\w+)@(\w+)\.(\w+)\.([a-z]{2,}$)>', '\\1 at \\2 dot \\3 dot \\4', 'josmessa@uk.ibm.com')); //finds the e-mail address and replaces the @ and . with "at" and "dot" (uses backreferences) ('josmessa at uk dot ibm dot com') ?> --EXPECTF-- |
