hello,
i need a regex that replaces in a html source code a special word (eg. orange) but not the word in htmltags (attributes):
<html>
<head></head>
<body>
this is a text without any tags! replace please the following word: orange<br>
this is the number twentyone, this is the number twentytwo, this is the orange number twentythree!
<image src="http://www.google.de/orange.gif" title="this is an orange" border="0"/>
<a href="http://www.google.de/orange.php">this is a link to a orange website, please do only replace the link text but not the uri!</a>
</body>
</html>
my first attempt was this regex:
(\>| |[\(])(orange)([\.\!\)\?\:\,]+| )(\>| |[\(])(orange)([\.\!\)\?\:\,]+| )
does not work in all conditions, would be great if someone could help me!
thanks in advance, roland