note 16688 added to ref.regex
| From: | erik at NO_SPAM dot tba dot com dot br | Date: | Fri, 09 Nov 2001 03:25:44 +0000 |
| Subject: | note 16688 added to ref.regex | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-20623@lists.php.net to get a copy of this message | ||
ereg (pattern, string [, regs])
The .pdf manual states that regs[0] contains a copy of string. That is *not* true. regs[0] contains
the substring found by pattern, while regs[1], regs[2] etc contain the substrings found by the
subpatterns surrounded by parenthesis from pattern. An example:
ereg("(S).*(L)", "MySQL", $regs);
/* returns:
$regs[0]="SQL"
$regs[1]="S" // first parenthesis
$regs[2]="L" // second parenthesis
*/
--
http://www.php.net/manual/en/ref.regex.php
http://master.php.net/manage/user-notes.php?action=edit+16688
http://master.php.net/manage/user-notes.php?action=delete+16688
http://master.php.net/manage/user-notes.php?action=reject+16688