View Single Post
Old 08-01-2009, 03:02 PM  
ProG
Confirmed User
 
Join Date: Apr 2009
Posts: 1,319
Quote:
Originally Posted by Killswitch View Post
I get the same error as nation-x, I had to remove the http:\/\/ from the regex as it's already in the database as having it, but I even str_replace'd it and still get the error.
Hm.. this works for me, did you double escape so that both \/ show?

Code:
$uri = 'http://www.bing.com/';
$uri = str_replace( '/', '\\/', $uri );
$back = 'bing';

preg_match_all("/<a\s[^>]*href=([\"\']??)({$uri}*?)([\"\']??)[^>]*>({$back})<\/a>/siU", $links, $matches);
print_r( $matches );
__________________
History will be kind to me for I intend to write it.
ProG is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote