diff options
author | Stanislav Malyshev <stas@php.net> | 2013-06-10 14:20:18 -0700 |
---|---|---|
committer | Stanislav Malyshev <stas@php.net> | 2013-06-10 14:20:18 -0700 |
commit | ac40c0b562b0f90652cadef83968d7305626c377 (patch) | |
tree | 450cd9d7b67422adfae2218a69d21fb02f921474 /ext/pcre/tests | |
parent | 04145dc2aa6eea37f7cd27ffa69ad3b2f52a65da (diff) | |
download | php-git-ac40c0b562b0f90652cadef83968d7305626c377.tar.gz |
Merge branch 'pull-request/341'
* pull-request/341: (23 commits)
typofixes
Diffstat (limited to 'ext/pcre/tests')
-rw-r--r-- | ext/pcre/tests/preg_replace_basic.phpt | 2 | ||||
-rw-r--r-- | ext/pcre/tests/preg_replace_edit_basic.phpt | 2 | ||||
-rw-r--r-- | ext/pcre/tests/preg_split_basic.phpt | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/ext/pcre/tests/preg_replace_basic.phpt b/ext/pcre/tests/preg_replace_basic.phpt index 33fb2d4a8a..6962bce255 100644 --- a/ext/pcre/tests/preg_replace_basic.phpt +++ b/ext/pcre/tests/preg_replace_basic.phpt @@ -11,7 +11,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]>', '4', $string)); //finds any number that's not 4 and replaces it with a 4 ('444444444') var_dump(preg_replace('<\b[hH]\w{2,4}>', 'Bonjour', $string)); //finds h or H at the beginning of a word followed by 2-4 characters and replaces it with Bonjour (i.e. Hello -> Bonjour) (was finding the 'his' in This and replacing it) -var_dump(preg_replace('<(\w)\s*-\s*(\w)>', '\\1. \\2', $string)); //finds dashes with an indefinate amount of whitespace around them and replaces them with a full stop precedeby no spaces and followed by one space +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,}$)>', '\\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') ?> diff --git a/ext/pcre/tests/preg_replace_edit_basic.phpt b/ext/pcre/tests/preg_replace_edit_basic.phpt index 97350e756e..556b48b8c1 100644 --- a/ext/pcre/tests/preg_replace_edit_basic.phpt +++ b/ext/pcre/tests/preg_replace_edit_basic.phpt @@ -24,7 +24,7 @@ var_dump(preg_replace('<\b[hH]\w{2,4}>', 'Bonjour', $string)); //finds h or H at the beginning of a word followed by 2-4 characters and replaces it with Bonjour (i.e. Hello -> Bonjour) (was finding the 'his' in This and replacing it) var_dump(preg_replace('<(\w)\s*-\s*(\w)>', - '\\1. \\2', $string)); //finds dashes with an indefinate amount of whitespace around them and replaces them with a full stop precedeby no spaces and followed by one space + '\\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,}$)>', '\\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') diff --git a/ext/pcre/tests/preg_split_basic.phpt b/ext/pcre/tests/preg_split_basic.phpt index e94a94f62e..5d23ce6df1 100644 --- a/ext/pcre/tests/preg_split_basic.phpt +++ b/ext/pcre/tests/preg_split_basic.phpt @@ -7,7 +7,7 @@ Test preg_split() function : basic functionality * Function is implemented in ext/pcre/php_pcre.c */ $string = 'this is a_list: value1, Test__, string; Hello, world!_(parentheses)'; -var_dump(preg_split('/[:,;\(\)]/', $string, -1, PREG_SPLIT_NO_EMPTY)); //parts of $string seperated by : , ; ( or ) are put into an array. +var_dump(preg_split('/[:,;\(\)]/', $string, -1, PREG_SPLIT_NO_EMPTY)); //parts of $string separated by : , ; ( or ) are put into an array. var_dump(preg_split('/:\s*(\w*,*\s*)+;/', $string)); //all text between : and ; is removed var_dump(preg_split('/(\(|\))/', $string, -1, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY)); //all text before (parentheses) is put into first element, ( into second, "parentheses" into third and ) into fourth. var_dump(preg_split('/NAME/i', $string)); //tries to find NAME regardless of case in $string (can't split it so just returns how string as first element) |