Posted by gene.ellis on 12/08/05 20:08
Hello everyone,
This should be extremely simple for youregular expression gurus out
there. I am looking for a regular expression that will look for the
hyperlinks within a string, and then add some simple code before the
hyperlinks, but only if they do not match a certain URL. For example.
$string ="This is a <a href='http://www.ur1.com'>Hyperlink</a> and this
is a <a href='http://www.ur2.com'> Hyperlink</a>";
I would like to a regular expression to look in the string for
hyperlinks that start with "http://www.ur1" and change add some code to
it like so that the string is modified like:
$string ="This is a <a
href=javascript:'http://www.ur1.com'>Hyperlink</a> and this is a <a
href='http://www.ur2.com'> Hyperlink</a>";
That's it. Thank you very much for your help!
[Back to original message]
|