Page 1 of 1

preg_replace bug?

Posted: Fri Apr 04, 2008 9:11 pm
by yufold

Code: Select all

<?
 
$txt = <<< endoftxt
<tr><td><div class="infobox-spacer"></div><ul><li><div>Level: 60</div></li><li><div>Requires level 60</div></li><li><div>Side: Both</div></li><li><div>Start: <a href="/?item=20644">Nightmare Engulfed Object</a></div></li><li><div>End: <a href="/?npc=11832">Keeper Remulos</a></div></li><li><div>Difficulty: <span class="r2">60</span><small> &nbsp;</small><span class="r3">63</span><small> &nbsp;</small><span class="r4">72</span></div></li></ul></td></tr><tr><th>Series</th></tr><tr><td><div class="infobox-spacer"></div><table class="series"><tr><th>1.</th><td><div><b>Shrouded in Nightmare</b></div></td></tr><tr><th>2.</th><td><div><a href="/?quest=8447">Waking Legends</a></div></td></tr></table></td></tr>
endoftxt;
 
  echo preg_replace("/(?<=href=\"[\/?]{2})\w{1,}[=][0-9]{1,}\">(([a-zA-Z]+\s*)+)/"  ,"xx", $txt);
$txt1 = 'dddsssf'; /// work
 
  echo preg_replace("/(?<=href=\"[\/?]{2}\w{1,})[=][0-9]{1,}\">(([a-zA-Z]+\s*)+)/"  ,"xx", $txt);
$txt1 = 'dddsssf'; /// not work, no show
 
 
 why? i just move ) .
 
?>

Re: preg_replace bug?

Posted: Fri Apr 04, 2008 9:21 pm
by John Cartwright
Question? Problem? Explanation?

Re: preg_replace bug?

Posted: Sat Apr 05, 2008 8:42 pm
by John Cartwright
Since you made another duplicate thread I'm going to close this one.