Re: help with regex in preg_match();
| From: | Mirza Muharemagic | Date: | Mon, 01 Jul 2002 17:52:03 +0000 |
| Subject: | Re: help with regex in preg_match(); | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-104736@lists.php.net to get a copy of this message | ||
Hi,
something like this:
$QUERY_STRING = "siteUserList.cgi?group=site177&2345";
if
(preg_match("#siteUserList.cgi\?group=site177(&?[\d]*)#",$QUERY_STRING,$array11))
{
echo "found: $array11[0]<br />$array11[1]";
}
Mirza mirza@php.co.ba
01.07.2002 19:37
> Hi people,
> I got this line that is relly giving me a pain..:
> if (preg_match("@siteUserList.cgi\?group=site177(&?)@",
> $QUERY_STRING))
> As you can see it just matches the query string when it looks like
> this: siteUserList.cgi?group=site177& (with or without a "&")
> The thing is I need it to match also if after the "&" there is a number
> (that will have more than 1 digit)
> Ive tried many diffrent thing with \d+ but I can get it to work.. can
> somebody give me some light? Thanks.