It depends of the last parameter to preg_match_all.
PREG_PATTERN_ORDER and PREG_SET_ORDER.
One of these is the default value.
|<a (.*?)>(.*?)></a>|

PREG_PATTERN_ORDER :
----Orders results so that $matches[0] is an array of full pattern matches, 
$matches[1] is an array of strings matched by the first
parenthesized subpattern, and so on. Using above pattern if we have some links in text 
to search for matches then
$matches[1][0],$matches[1][1].... will contain the params of <a> . 
$matches[2][0],$matches[2][1].... will contain the link text.

PREG_SET_ORDER :
----Orders results so that $matches[0] is an array of first set of matches, 
$matches[1] is an array of second set of matches, and so
on. Using above pattern $matches[1][0] will be te params for fist matched link. 
$matches[1][1] link text. $matches[2][0] params of
second matched <a>, $matches[2][1] link text ...and so on.


Andrey Hristov
IcyGEN Corporation
http://www.icygen.com
99%


----- Original Message -----
From: "_lallous" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, August 30, 2001 1:40 PM
Subject: [PHP] Re: If i use preg_match() how can i preg_match next?


> I don't really get it! in preg_match_all()
> the $matches array what will it contain?
>
> i mean $matches[0] is the whole match, and every $match[0][1] $match[0][2]
> $match[0][n] is my subexpression.
> now what does the $match[1] have? or $match[2] ?
>
> I usually use these modifiers: "/is"
>
> "Cc Zona" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > In article <[EMAIL PROTECTED]>,
> >  [EMAIL PROTECTED] (_lallous) wrote:
> >
> > > If i have this string: "1 2 3 4 5 6 7 no more!"
> > > and this regular expression: "([0-9]+)"
> > >
> > > now how can i run preg_match to get result by result until no results
> are
> > > returned?
> >
> > <http://php.net/preg_match_all>
> >
> > --
> > CC
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to