[advanced search]
Results from the most recent live auction are here.
14 members in the live chat room. Join Chat!
Register Rules & FAQ NP$ Store Active Threads Mark Forums Read
Go Back   NamePros.Com > Design and Development > Programming
User Name
Password

Old 04-28-2008, 07:48 PM   · #1
SGBoise
New Member
 
SGBoise's Avatar
 
Location: GamePacks.org
Trader Rating: (1)
Join Date: Feb 2008
Posts: 15
NP$: 0.00 (Donate)
SGBoise is an unknown quantity at this point
Help! 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 Code:
/category/3/pictures45.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


Please register or log-in into NamePros to hide ads
__________________
GamePacks.org - Products for the Arcade/Media Community
TopMediaScript.com - The ultimate media site script
AutoVideoScript.com - Run your own youtube sharing site
GameScraper.com - Scrap Games from other arcade sites
SGBoise is offline   Reply With Quote
Old 04-28-2008, 09:44 PM   · #2
DylanButler
NamePros Regular
 
DylanButler's Avatar
 
Name: Dylan Butler
Location: San Diego, CA
Trader Rating: (38)
Join Date: Jan 2006
Posts: 694
NP$: 0.00 (Donate)
DylanButler is a splendid one to beholdDylanButler is a splendid one to beholdDylanButler is a splendid one to beholdDylanButler is a splendid one to beholdDylanButler is a splendid one to beholdDylanButler is a splendid one to beholdDylanButler is a splendid one to behold
This one worked for me:

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

Coming soon: examp
DylanButler is offline   Reply With Quote
Old 04-29-2008, 11:50 AM   · #3
SGBoise
New Member
 
SGBoise's Avatar
 
Location: GamePacks.org
Trader Rating: (1)
Join Date: Feb 2008
Posts: 15
NP$: 0.00 (Donate)
SGBoise is an unknown quantity at this point
Originally Posted by DylanButler
This one worked for me:

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



Thanks buddy.
__________________
GamePacks.org - Products for the Arcade/Media Community
TopMediaScript.com - The ultimate media site script
AutoVideoScript.com - Run your own youtube sharing site
GameScraper.com - Scrap Games from other arcade sites
SGBoise is offline   Reply With Quote
Reply

NamePros is a revenue sharing forum.

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


Site Sponsors
Find out how! Buy Flash Arcade Game Script http://www.mobisitetrader.com/
Advertise your business at NamePros
All times are GMT -7. The time now is 08:41 AM.


Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0