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