Hey Monks,
I've spent a fair amount of time doing somewhat basic regular expressions, but this one really has me stumped. I'm writing an web encyclopedia feature, such that the first occurrence of a given word is turned into a hyperlink to the encyclopedia entry. The problem is that the text being replaced may already have hyperlinks in it, and that some encyclopedia terms include other terms. For example, simplistic regular expressions fail when asked to add links to Globalization on this text:
Oh no, <a href="/encyclopedia/Anti-Globalization/index.html">Anti-glob +alization</a> activists are coming! Globalization is rejected by...
In this case, we would obviously want the script to ignore the url and the linked text, and instead place the new link in the last sentence.
Thanks so much
In reply to Searching for text not inside a hyperlink by aemain
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |