tags:

views:

13

answers:

0

I'm trying to match all the URLs that end in .html and if they have ? after it's OK but if it's odd then not so

preg_match("/article-(.+?).html/i", getenv('REQUEST_URI')) <-- good preg_match("/article-(.+?).html*?*/i", getenv('REQUEST_URI')) <-- good

basically i want to match it if it end in .html or ends in .html? and if it has a ? then anything after is ok. So basically

article-1.html <-- "true"

article-1.html? <-- "true"

article-1.html?sdfasdfas <-- "true"

article-1.html%20blah <-- "false"

Thanks!