I want to add a call to a onclick event in any href that includes a mailto: tag.
For instance, I want to take any instance of:
<a href="mailto:[email protected]">
And change it into:
<a href="mailto:[email protected]" onclick="return function();">
The problem that I'm having is that the value of the mailto string is not consistent.
I need to say something like replace all instances of the '>
' character with ' onclick="return function();">
' in strings that match '<a href="mailto:*">
' .
I am doing this in ColdFusion using the REreplacenocase() function but general RegEx suggestions are welcome.