note 16688 deleted from ref.regex by jimw

From: Date: Fri, 07 Dec 2001 21:53:48 +0000
Subject: note 16688 deleted from ref.regex by jimw
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-22041@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 */

« previous php.notes (#22041) next »