ereg will now return real match count instead of

a fixed-size 10 element array


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@64733 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Hartmut Holzgraefe 2001-12-11 20:32:16 +00:00
parent 118515263e
commit 68caa3667e

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.32 $ -->
<!-- $Revision: 1.33 $ -->
<reference id="ref.regex">
<title>Regular Expression Functions (POSIX Extended)</title>
<titleabbrev>Regexps</titleabbrev>
@ -128,16 +128,18 @@ $string = ereg_replace ("\n", "", $string);
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.
</simpara>
<simpara>
If <function>ereg</function> finds any matches at all, $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 <function>ereg</function>'s ability to
match more substrings. If no matches are found, $regs will not be
altered by <function>ereg</function>.
</simpara>
<simpara>
</simpara>
<note>
<simpara>
Up to (and including) PHP 4.1.0 <literal>$regs</literal> 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 <function>ereg</function>'s ability to match more
substrings. If no matches are found, <literal>$regs</literal>
will not be altered by <function>ereg</function>.
</simpara>
</note>
<simpara>
Searching is case sensitive.
</simpara>
<simpara>