Question regarding php Regular expression filenames

Posted by jason on Stack Overflow See other posts from Stack Overflow or by jason
Published on 2010-04-05T11:37:44Z Indexed on 2010/04/05 11:43 UTC
Read the original article Hit count: 259

Filed under:

I am very bad at regular expressions, but I have a regular expression that is working okay, except for one issue:

/\/(.*?).php/

I only need this regular expression to find things like:

/this-a-valid-page.php {some words here} /anotherpage.php { some words here} http://www.google.com

but do not find URLs the problem i am having is that it find this parts of full URLS i want it to avoid these all together. http://www.google.com/page.php because i have another function that does something different than the filename reg exp.

© Stack Overflow or respective owner

Related posts about php