Dynadot โ€” .com Transfer

Can't get regex to match properly

Spacemail by SpaceshipSpacemail by Spaceship
Watch

SGBoise

Established Member
Impact
1
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

With this regex I got to match the category and id.
PHP:
preg_match("/^\/category\/(?P<id>\d+)/", $url, $matches);

With this regex I got to match the pagenumber.
PHP:
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:
preg_match("/^\/category\/(?P<id>\d+)(?P<pagenumber>\d).html/", $url, $matches);

What am I doing wrong?

Thanks guys
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
Unstoppable DomainsUnstoppable Domains
This one worked for me:

/category/([0-9]+)/pictures([0-9]+).html
 
0
•••
DylanButler said:
This one worked for me:

/category/([0-9]+)/pictures([0-9]+).html

Thanks buddy.
 
0
•••
Appraise.net
Domain Recover
DomainEasy โ€” Live Options
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back