Date: 08/30/01
- Next message: Kyle Smith: "Re: [PHP] Quick TXT document stuff"
- Previous message: Andrey Hristov: "Re: [PHP] Associative arrays (names and strings)"
- In reply to: Andrey Hristov: "Re: [PHP] Re: If i use preg_match() how can i preg_match next?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Thanks alot Andrey.
"Andrey Hristov" <ahristov <email protected>> wrote in message
news:017a01c13139$e1bb2600$0b01a8c0 <email protected>
> 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" <elias_bachaalany <email protected>>
> To: <php-general <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" <cczona <email protected>> wrote in message
> > news:20010830085210.3727.qmail <email protected>
> > > In article <20010830083215.95556.qmail <email protected>>,
> > > elias_bachaalany <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: php-general-unsubscribe <email protected>
> > For additional commands, e-mail: php-general-help <email protected>
> > To contact the list administrators, e-mail: php-list-admin <email protected>
> >
> >
>
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe <email protected> For additional commands, e-mail: php-general-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Kyle Smith: "Re: [PHP] Quick TXT document stuff"
- Previous message: Andrey Hristov: "Re: [PHP] Associative arrays (names and strings)"
- In reply to: Andrey Hristov: "Re: [PHP] Re: If i use preg_match() how can i preg_match next?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

