View Single Post
Old 04-28-2008, 10:57 PM   #1 (permalink)
SGBoise
Platinum Lifetime Member
 
SGBoise's Avatar
 
Last Online: 05-15-2008 02:37 AM
iTrader: (1)
Join Date: Jan 2008
Posts: 10
DNF$: 60
Location: USA


Can't get regex to match properly

I am trying to match this uri. Also I want 3 to match as id and 45 in pictures45.html as pagenumber.
[HTML]/category/3/pictures45.html[/HTML]
With this regex I got to match the category and id.
PHP Code:
preg_match("/^\/category\/(?P<id>\d+)/"$url$matches); 
With this regex I got to match the pagenumber.
PHP Code:
preg_match("/(?P<pagenumber>\d).html/"$url$matches); 
I figured I can combine both the regex and it should work but I can't get it to work.
PHP Code:
preg_match("/^\/category\/(?P<id>\d+)(?P<pagenumber>\d).html/"$url$matches); 
What am I doing wrong?
Thanks guys
__________________
GamePacks.org - Products for the Arcade/Media Community
TopMediaScript com - The ultimate media site script
AutoVideoScript com - Run your own youtube sharing site
SGBoise is offline   Reply With Quote