would like to replace all occurence of, double quote included
"http://somebunchofchar"
to
"link"
I came up with preg_replace("/\"http:\/\/.\"/i", "\"link\"", $string);
would like to replace all occurence of, double quote included
"http://somebunchofchar"
to
"link"
I came up with preg_replace("/\"http:\/\/.\"/i", "\"link\"", $string);
Just add an asterisk and question mark after dot
preg_replace("/\"http:\/\/.*?\"/i", "\"link\"", $string);
Just look here: http://regexlib.com/DisplayPatterns.aspx?cattabindex=1&categoryId=2&AspxAutoDetectCookieSupport=1 how to match an URL with the correct pattern; than use preg_replace with the particular regexp pattern ;-) (you can add those quotes at the start and end to the pattern yourself quite easily) :-)