PHP regexp problem

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hi Can someone please give me a hand fixing this regular expression to
catch everything inside the title tag quotes?

$result=3D'<p><img class=3D\"marker\" src=3D\"images/marker-html.gif\"
onclick=3D\"top.left.editMarker(this)\" title=3D\" &lt;input name=3D\" i=3D
\"\" id=3D\"marker1\" type=3D\"\'input\'\" &gt;=3D\"\" /></p><p>this is som=
text below the html</p>';

//$result=3Dpreg_replace('!<img class(.*?)title=3D(.*?)/>!', "$2",
$result);  //WORKS
$result=3Dpreg_replace('!<img class(.*?)title=3D//"(.*?)" />!', "$2",
$result);  //DOES NOT WORK!!

echo $result;


Re: PHP regexp problem

Ciaran wrote:
Quoted text here. Click to load it

Solved this by using double quotes for all regexps and escaping them
where needed. I don't really understand this problem but I hope this
helps save some brain melting for someone else!

Site Timeline