Hey all,
I'm having a few troubles with a regular expression in PHP. Basically, the regular expression I'm using is:
Code:
preg_replace("@/{$cat}/{$cDesc}/\" title=\"(.+)\">(.+)</a></li>@","@/{$cat}/{$cDesc}/\" title=\"$1\">$2</a>". $output ."</li>@", $navBar);
This would change, for example:
Code:
<li><a href="http://www.tauonline.org/TrialV7/Cat.php/14/ImperialGuard/" title="Fall in, soldier, and we will teach you how to fight for the Emperor!">Imperial Guard</a></li>
<li><a href="http://www.tauonline.org/TrialV7/Cat.php/15/ChaosSpaceMarines/" title="This section is for the ways of the Forces of Chaos.">Chaos Space Marines</a></li>
<li><a href="http://www.tauonline.org/TrialV7/Cat.php/16/DaemonHunters/" title="Discover how to better protect Humanity from the Daemonic Hordes!">Daemon Hunters</a></li>
<li><a href="http://www.tauonline.org/TrialV7/Cat.php/17/WitchHunters/" title="Discover how to seek out the Heretic, Mutant and Traitor.">Witch Hunters</a></li>
<li><a href="http://www.tauonline.org/TrialV7/Cat.php/18/Tyranids/" title="The Tyranids hunt their prey here.">Tyranids</a></li>
into:
Code:
<li><a href="http://www.tauonline.org/TrialV7/Cat.php/14/ImperialGuard/" title="Fall in, soldier, and we will teach you how to fight for the Emperor!">Imperial Guard</a></li>
<li><a href="http://www.tauonline.org/TrialV7/Cat.php/15/ChaosSpaceMarines/" title="This section is for the ways of the Forces of Chaos.">Chaos Space Marines</a></li>
<li><a href="http://www.tauonline.org/TrialV7/Cat.php@/16/DaemonHunters/" title="Discover how to better protect Humanity from the Daemonic Hordes!">Daemon Hunters</a><ul>
<li title="This allows you to see only articles (in this categeory) of the selected type" class="SmallText">Filter Articles By:</li>
<li class="SmallText"><a href="http://www.tauonline.org/TrialV7/Cat.php/16/DaemonHunters/House Rule" title="View only Daemon Hunters articles only of the type 'House Rule'">House Rule</a></li>
<li class="SmallText"><a href="http://www.tauonline.org/TrialV7/Cat.php/16/DaemonHunters/Tactics" title="View only Daemon Hunters articles only of the type 'Tactics'">Tactics</a></li>
</ul></li>@
<li><a href="http://www.tauonline.org/TrialV7/Cat.php/17/WitchHunters/" title="Discover how to seek out the Heretic, Mutant and Traitor.">Witch Hunters</a></li>
<li><a href="http://www.tauonline.org/TrialV7/Cat.php/18/Tyranids/" title="The Tyranids hunt their prey here.">Tyranids</a></li>
As you can see, the "@" signs I'm using as delimiters in the reg. exp are being outputted - any ideas why, and how can I stop this?
Thanks,
Tristan