Jinxy
01-08-2010, 08:17 PM
I wonder if someone would do me a small favor and help me with a regex problem? This code was written by somebody else but it works great for extracting link urls on a page. But I don't want it to look for ALL links, just the links that have this this beginning"
/search.php?
So actually the links would look like this
<a href="/search.php?????">
$source = preg_replace("/a[\s]+[^>]*?href[\s]?=[\s\"\']+"."(.*?)[\"\']+.*?>"."([^<]+|.*?)?<\/a>/", urlencode($source), $source);
Thanks!
/search.php?
So actually the links would look like this
<a href="/search.php?????">
$source = preg_replace("/a[\s]+[^>]*?href[\s]?=[\s\"\']+"."(.*?)[\"\']+.*?>"."([^<]+|.*?)?<\/a>/", urlencode($source), $source);
Thanks!