diff --git a/appendices/extensions.xml b/appendices/extensions.xml index 8efbc59afc..446829c8d1 100644 --- a/appendices/extensions.xml +++ b/appendices/extensions.xml @@ -136,7 +136,6 @@ - @@ -229,7 +228,6 @@ - diff --git a/appendices/migration70/incompatible/removed-functions.xml b/appendices/migration70/incompatible/removed-functions.xml index 4c7352e7c2..ffac64c434 100644 --- a/appendices/migration70/incompatible/removed-functions.xml +++ b/appendices/migration70/incompatible/removed-functions.xml @@ -27,7 +27,7 @@ All ereg* functions - All ereg functions were removed. + All ereg functions were removed. PCRE is a recommended alternative. diff --git a/reference/pcre/book.xml b/reference/pcre/book.xml index 9ca93e33f6..8cb99ebdb1 100644 --- a/reference/pcre/book.xml +++ b/reference/pcre/book.xml @@ -25,10 +25,6 @@ See Pattern Modifiers. - - PHP also supports regular expressions using a POSIX-extended syntax - using the POSIX-extended regex functions. - This extension maintains a global per-thread cache of compiled regular diff --git a/reference/pcre/pattern.posix.xml b/reference/pcre/pattern.posix.xml deleted file mode 100644 index 497fd12055..0000000000 --- a/reference/pcre/pattern.posix.xml +++ /dev/null @@ -1,130 +0,0 @@ - - -
- Differences from POSIX regex - - - The POSIX Regex extension - is deprecated. There are a number of differences between POSIX regex and - PCRE regex. This page lists the most notable ones that are necessary to - know when converting to PCRE. - - - - - - - The PCRE functions require that the pattern is enclosed by delimiters. - - - - - Unlike POSIX, the PCRE extension does not have dedicated functions for - case-insensitive matching. Instead, this is supported using the - i (PCRE_CASELESS) pattern modifier. Other - pattern modifiers are also available for changing the matching strategy. - - - - - The POSIX functions find the longest of the leftmost match, but PCRE - stops on the first valid match. If the string doesn't match at all it - makes no difference, but if it matches it may have dramatic effects on - both the resulting match and the matching speed. - - - To illustrate this difference, consider the following example from - "Mastering Regular Expressions" by Jeffrey Friedl. Using the pattern - one(self)?(selfsufficient)? on the string - oneselfsufficient with PCRE will result in matching - oneself, but using POSIX the result will be the full - string oneselfsufficient. Both (sub)strings match the - original string, but POSIX requires that the longest be the result. - - - - - The POSIX definition of a "character class" differs from that of PCRE. - Simple bracket expressions to match a set of explicit characters are - supported in the form of PCRE - character classes - but POSIX collating elements, character classes and character equivalents - are not supported. - - - Supplying an expression with a character class that both starts and ends - with :, . or = - characters to PCRE is interpreted as an attempt to use one of these - unsupported features and causes a compilation error. - - - - - - - - Function replacements - - - - POSIX - PCRE - - - - - ereg_replace - preg_replace - - - ereg - preg_match - - - eregi_replace - preg_replace - - - eregi - preg_match - - - split - preg_split - - - spliti - preg_split - - - sql_regcase - No equivalent - - - -
-
-
- - diff --git a/reference/pcre/pattern.xml b/reference/pcre/pattern.xml index 11316faaea..12d943f95e 100644 --- a/reference/pcre/pattern.xml +++ b/reference/pcre/pattern.xml @@ -7,7 +7,6 @@ &reference.pcre.pattern.syntax; &reference.pcre.pattern.modifiers; &reference.pcre.pattern.differences; - &reference.pcre.pattern.posix; - - - - Regular Expression (POSIX Extended) - POSIX Regex - - - &reftitle.intro; - - &warn.deprecated.feature.5-3-0.removed.7-0-0.alternatives; - - - PCRE - (for full regular expression support) - - - fnmatch - (for simpler shell style wildcard pattern matching) - - - - - - PHP also supports regular expressions using a Perl-compatible syntax - using the PCRE functions. Those functions - support non-greedy matching, assertions, conditional subpatterns, and a - number of other features not supported by the POSIX-extended regular - expression syntax. - - - - - These regular expression functions are not binary-safe. The PCRE functions are. - - - - Regular expressions are used for complex string manipulation. - PHP uses the POSIX extended regular expressions as defined by POSIX - 1003.2. For a full description of POSIX regular expressions see the regex - man pages included in the regex directory in the PHP distribution. It's - in manpage format, so you'll want to do something along the lines of - man /usr/local/src/regex/regex.7 in order to read it. - - - - &reference.regex.setup; - &reference.regex.constants; - &reference.regex.examples; - &reference.regex.reference; - - - - diff --git a/reference/regex/configure.xml b/reference/regex/configure.xml deleted file mode 100644 index 3052b533fa..0000000000 --- a/reference/regex/configure.xml +++ /dev/null @@ -1,52 +0,0 @@ - - -
- &reftitle.install; - -
- PHP 7 - - &pecl.info; - &url.pecl.package;regex. - -
- -
- PHP 5 - - - Do not change the TYPE unless you know what you are doing. - - - - To enable regexp support configure PHP - . TYPE can be one of - system, apache, php. - The default value is php. - - &windows.builtin; -
- -
- - - diff --git a/reference/regex/constants.xml b/reference/regex/constants.xml deleted file mode 100644 index 04dbada782..0000000000 --- a/reference/regex/constants.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - &reftitle.constants; - &no.constants; - - - - diff --git a/reference/regex/examples.xml b/reference/regex/examples.xml deleted file mode 100644 index 2a594dfc97..0000000000 --- a/reference/regex/examples.xml +++ /dev/null @@ -1,62 +0,0 @@ - - - - - &reftitle.examples; - - - Regular Expression Examples - - tag at the beginning of $string. -$string = ereg_replace("^", "
", $string); - -// Put a
tag at the end of $string. -$string = ereg_replace("$", "
", $string); - -// Get rid of any newline characters in $string. -$string = ereg_replace("\n", "", $string); -?> -]]> -
-
-
-
- - - diff --git a/reference/regex/functions/ereg-replace.xml b/reference/regex/functions/ereg-replace.xml deleted file mode 100644 index 754678c4d9..0000000000 --- a/reference/regex/functions/ereg-replace.xml +++ /dev/null @@ -1,181 +0,0 @@ - - - - - ereg_replace - Replace regular expression - - - - - &warn.deprecated.function.5-3-0.removed.7-0-0.alternatives; - - preg_replace - - - - - - &reftitle.description; - - stringereg_replace - stringpattern - stringreplacement - stringstring - - - This function scans string for matches to - pattern, then replaces the matched text - with replacement. - - - - - &reftitle.parameters; - - - - pattern - - - A POSIX extended regular expression. - - - - - replacement - - - If pattern contains parenthesized substrings, - replacement may contain substrings of the form - \digit, which will be - replaced by the text matching the digit'th parenthesized substring; - \0 will produce the entire contents of string. - Up to nine substrings may be used. Parentheses may be nested, in which - case they are counted by the opening parenthesis. - - - - - string - - - The input string. - - - - - - - - - &reftitle.returnvalues; - - The modified string is returned. If no matches are found in - string, then it will be returned unchanged. - - - - - &reftitle.examples; - - For example, the following code snippet prints "This was a test" - three times: - - - - <function>ereg_replace</function> example - - -]]> - - - - - One thing to take note of is that if you use an integer value as - the replacement parameter, you may not get - the results you expect. This is because - ereg_replace will interpret the number as - the ordinal value of a character, and apply that. For instance: - - - - <function>ereg_replace</function> example - - -]]> - - - - - - Replace URLs with links - -[:space:]]+[[:alnum:]/]", - '\\0', $text); -?> -]]> - - - - - - - &reftitle.seealso; - - - ereg - eregi - eregi_replace - str_replace - preg_replace - quotemeta - - - - - - - diff --git a/reference/regex/functions/ereg.xml b/reference/regex/functions/ereg.xml deleted file mode 100644 index 1b883b4b74..0000000000 --- a/reference/regex/functions/ereg.xml +++ /dev/null @@ -1,177 +0,0 @@ - - - - - ereg - Regular expression match - - - - - &warn.deprecated.function.5-3-0.removed.7-0-0.alternatives; - - preg_match - - - - - - &reftitle.description; - - intereg - stringpattern - stringstring - arrayregs - - - Searches a string for matches to the regular - expression given in pattern in a case-sensitive - way. - - - - - &reftitle.parameters; - - - - pattern - - - Case sensitive regular expression. - - - - - string - - - The input string. - - - - - regs - - - If matches are found for parenthesized substrings of - pattern and the function is called with the - third argument regs, the matches will be stored - in the elements of the array regs. - - - $regs[1] will contain the substring which starts at - the first left parenthesis; $regs[2] will contain - the substring starting at the second, and so on. - $regs[0] will contain a copy of the complete string - matched. - - - - - - - - - &reftitle.returnvalues; - - Returns the length of the matched string if a match for - pattern was found in string, - or &false; if no matches were found or an error occurred. - - - If the optional parameter regs was not passed or - the length of the matched string is 0, this function returns 1. - - - - - &reftitle.changelog; - - - - - - &Version; - &Description; - - - - - 4.1.0 - - Up to (and including) PHP 4.1.0 $regs will be - filled with exactly ten elements, even though more or fewer than - ten parenthesized substrings may actually have matched. This has - no effect on ereg's ability to match more - substrings. If no matches are found, $regs - will not be altered by ereg. - - - - - - - - - - &reftitle.examples; - - - <function>ereg</function> example - - The following code snippet takes a date in ISO format (YYYY-MM-DD) and - prints it in DD.MM.YYYY format: - - - -]]> - - - - - - - &reftitle.seealso; - - - eregi - ereg_replace - eregi_replace - preg_match - strpos - strstr - quotemeta - - - - - - - diff --git a/reference/regex/functions/eregi-replace.xml b/reference/regex/functions/eregi-replace.xml deleted file mode 100644 index 859b8f972e..0000000000 --- a/reference/regex/functions/eregi-replace.xml +++ /dev/null @@ -1,134 +0,0 @@ - - - - - eregi_replace - Replace regular expression case insensitive - - - - - &warn.deprecated.function.5-3-0.removed.7-0-0.alternatives; - - - preg_replace - (with the i (PCRE_CASELESS) - modifier) - - - - - - - &reftitle.description; - - stringeregi_replace - stringpattern - stringreplacement - stringstring - - - This function is identical to ereg_replace - except that this ignores case distinction when matching - alphabetic characters. - - - - - &reftitle.parameters; - - - - pattern - - - A POSIX extended regular expression. - - - - - replacement - - - If pattern contains parenthesized substrings, - replacement may contain substrings of the form - \digit, which will be - replaced by the text matching the digit'th parenthesized substring; - \0 will produce the entire contents of string. - Up to nine substrings may be used. Parentheses may be nested, in which - case they are counted by the opening parenthesis. - - - - - string - - - The input string. - - - - - - - - - &reftitle.returnvalues; - - The modified string is returned. If no matches are found in - string, then it will be returned unchanged. - - - - - &reftitle.examples; - - - Highlight search results - -[^<]*)('. quotemeta($_GET['search']) .')'; -$replacement = '\\1\\2'; -$body = eregi_replace($pattern, $replacement, $body); -?> -]]> - - - - - - - &reftitle.seealso; - - - ereg - eregi - ereg_replace - preg_replace - quotemeta - - - - - - diff --git a/reference/regex/functions/eregi.xml b/reference/regex/functions/eregi.xml deleted file mode 100644 index 9ee942c4c6..0000000000 --- a/reference/regex/functions/eregi.xml +++ /dev/null @@ -1,145 +0,0 @@ - - - - - eregi - Case insensitive regular expression match - - - - - &warn.deprecated.function.5-3-0.removed.7-0-0.alternatives; - - - preg_match - (with the i (PCRE_CASELESS) - modifier) - - - - - - - &reftitle.description; - - interegi - stringpattern - stringstring - arrayregs - - - This function is identical to ereg except that it - ignores case distinction when matching alphabetic characters. - - - - - &reftitle.parameters; - - - - pattern - - - Case insensitive regular expression. - - - - - string - - - The input string. - - - - - regs - - - If matches are found for parenthesized substrings of - pattern and the function is called with the - third argument regs, the matches will be stored - in the elements of the array regs. - - - $regs[1] will contain the substring which starts at - the first left parenthesis; $regs[2] will contain - the substring starting at the second, and so on. - $regs[0] will contain a copy of the complete string - matched. - - - - - - - - - &reftitle.returnvalues; - - Returns the length of the matched string if a match for - pattern was found in string, - or &false; if no matches were found or an error occurred. - - - If the optional parameter regs was not passed or - the length of the matched string is 0, this function returns 1. - - - - - &reftitle.examples; - - - <function>eregi</function> example - - -]]> - - - - - - - &reftitle.seealso; - - - ereg - ereg_replace - eregi_replace - preg_match - stripos - stristr - quotemeta - - - - - - diff --git a/reference/regex/functions/split.xml b/reference/regex/functions/split.xml deleted file mode 100644 index a3bd79a09d..0000000000 --- a/reference/regex/functions/split.xml +++ /dev/null @@ -1,190 +0,0 @@ - - - - - split - Split string into array by regular expression - - - - - &warn.deprecated.function.5-3-0.removed.7-0-0.alternatives; - - preg_split - explode - str_split - - - - - - &reftitle.description; - - arraysplit - stringpattern - stringstring - intlimit-1 - - - Splits a string into array by regular expression. - - - - - &reftitle.parameters; - - - - pattern - - - Case sensitive regular expression. - - - If you want to split on any of the characters which are considered - special by regular expressions, you'll need to escape them first. If - you think split (or any other regex function, for - that matter) is doing something weird, please read the file - regex.7, included in the - regex/ subdirectory of the PHP distribution. It's - in manpage format, so you'll want to do something along the lines of - man /usr/local/src/regex/regex.7 in order to read it. - - - - - string - - - The input string. - - - - - limit - - - If limit is set, the returned array will - contain a maximum of limit elements with the - last element containing the whole rest of - string. - - - - - - - - - &reftitle.returnvalues; - - Returns an array of strings, each of which is a substring of - string formed by splitting it on boundaries formed - by the case-sensitive regular expression pattern. - - - If there are n occurrences of - pattern, the returned array will contain - n+1 items. For example, if - there is no occurrence of pattern, an array with - only one element will be returned. Of course, this is also true if - string is empty. If an error occurs, - split returns &false;. - - - - - &reftitle.examples; - - - <function>split</function> example - - To split off the first four fields from a line from - /etc/passwd: - - - -]]> - - - - - - <function>split</function> example - - To parse a date which may be delimited with slashes, dots, or hyphens: - - -\n"; -?> -]]> - - - - - - - &reftitle.notes; - - - split is deprecated as of PHP 5.3.0. preg_split - is the suggested alternative to this function. If you don't require the power of regular - expressions, it is faster to use explode, which - doesn't incur the overhead of the regular expression engine. - - - - - For users looking for a way to emulate Perl's @chars = - split('', $str) behaviour, please see the examples for - preg_split or str_split. - - - - - - &reftitle.seealso; - - - preg_split - spliti - str_split - explode - implode - chunk_split - wordwrap - - - - - - - diff --git a/reference/regex/functions/spliti.xml b/reference/regex/functions/spliti.xml deleted file mode 100644 index d1f109c86c..0000000000 --- a/reference/regex/functions/spliti.xml +++ /dev/null @@ -1,167 +0,0 @@ - - - - - spliti - Split string into array by regular expression case insensitive - - - - - &warn.deprecated.function.5-3-0.removed.7-0-0.alternatives; - - - preg_split - (with the i (PCRE_CASELESS) - modifier) - - - - - - - &reftitle.description; - - arrayspliti - stringpattern - stringstring - intlimit-1 - - - Splits a string into array by regular expression. - - - This function is identical to split except that this - ignores case distinction when matching alphabetic characters. - - - - - &reftitle.parameters; - - - - pattern - - - Case insensitive regular expression. - - - If you want to split on any of the characters which are considered - special by regular expressions, you'll need to escape them first. If - you think spliti (or any other regex function, for - that matter) is doing something weird, please read the file - regex.7, included in the - regex/ subdirectory of the PHP distribution. It's - in manpage format, so you'll want to do something along the lines of - man /usr/local/src/regex/regex.7 in order to read it. - - - - - string - - - The input string. - - - - - limit - - - If limit is set, the returned array will - contain a maximum of limit elements with the - last element containing the whole rest of - string. - - - - - - - - - &reftitle.returnvalues; - - Returns an array of strings, each of which is a substring of - string formed by splitting it on boundaries formed - by the case insensitive regular expression pattern. - - - If there are n occurrences of - pattern, the returned array will contain - n+1 items. For example, if - there is no occurrence of pattern, an array with - only one element will be returned. Of course, this is also true if - string is empty. If an error occurs, - spliti returns &false;. - - - - - &reftitle.examples; - - This example splits a string using 'a' as the separator : - - <function>spliti</function> example - - -]]> - - &example.outputs; - - - [1] => BBB - [2] => CCC - [3] => DDD - [4] => EEEaGGGA -) -]]> - - - - - - - &reftitle.seealso; - - - preg_split - split - explode - implode - - - - - - - diff --git a/reference/regex/functions/sql-regcase.xml b/reference/regex/functions/sql-regcase.xml deleted file mode 100644 index 4060355c01..0000000000 --- a/reference/regex/functions/sql-regcase.xml +++ /dev/null @@ -1,104 +0,0 @@ - - - - - sql_regcase - Make regular expression for case insensitive match - - - - - &warn.deprecated.function.5-3-0.removed.7-0-0.alternatives; - - preg_match - preg_quote - - - - - - &reftitle.description; - - stringsql_regcase - stringstring - - - Creates a regular expression for a case insensitive match. - - - - - &reftitle.parameters; - - - - string - - - The input string. - - - - - - - - - &reftitle.returnvalues; - - Returns a valid regular expression which will match - string, ignoring case. This expression is - string with each alphabetic character converted to - a bracket expression; this bracket expression contains that character's - uppercase and lowercase form. Other characters remain unchanged. - - - - - &reftitle.examples; - - - <function>sql_regcase</function> example - - -]]> - - &example.outputs; - - - - - - - This can be used to achieve case insensitive pattern matching in - products which support only case sensitive regular expressions. - - - - - - diff --git a/reference/regex/reference.xml b/reference/regex/reference.xml deleted file mode 100644 index 87df75b687..0000000000 --- a/reference/regex/reference.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - POSIX Regex &Functions; - - &reftitle.seealso; - - &warn.deprecated.feature.5-3-0.removed.7-0-0.alternatives; - - - PCRE - (for full regular expression support) - - - fnmatch - (for simpler shell style wildcard pattern matching) - - - - - - &reference.regex.entities.functions; - - - - - diff --git a/reference/regex/setup.xml b/reference/regex/setup.xml deleted file mode 100644 index 2bd5c3c48e..0000000000 --- a/reference/regex/setup.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - &reftitle.setup; - -
- &reftitle.required; - &no.requirement; -
- - &reference.regex.configure; - -
- &reftitle.runtime; - &no.config; -
- -
- &reftitle.resources; - &no.resource; -
- -
- - - diff --git a/reference/regex/versions.xml b/reference/regex/versions.xml deleted file mode 100644 index ec0a021a0d..0000000000 --- a/reference/regex/versions.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file