1
I'm trying automate internal links within pages on my website. I need already linked text to be exempted.PHP匹配短语只有在以外<a href> tag
For the following example it should only replace the bolded text (Example).
<a class="Example" href="http://www.example.com/">Example</a>
<p>New **Example**</p>
I tried the following but it didn't work.
$re = '/(\b'.$search.'\b)+((?=.*<a)|(?!.*<\/a>))/';
$str=preg_replace($re, $replace, $text);
请格式化您的问题,这是没有意义的,因为它是 – mayersdesign
欢迎来到堆栈溢出! [义务链接](http://stackoverflow.com/a/1732454/2307070)关于为什么ṫ̨̗̺̭̮̞̗̜̮̗̙̫̺̖̭̯͊ͨ̌͒̍͘͘͟͝h̸͓̩̙͙̻̗͔̞̘̟̩̯͋͑͐a̴̧ͨͭ͒ͯ̓͐̇ͥ͢҉̨̳̜̤͍͖t̵̳̳͕͉͋̓͐ͦͬ̈̚是一个坏主意 –