I understand that thousands of similar questions have already been asked, but after 30 minutes of viewing, I could not find the one that relates to my specific situation.
I am looking for a solution to ColdFusion 7/8 or Javascript or JQuery. CF is preferred.
I need a script that will search for a large text string to find all case-insensitive instances ...
<a href="http://[something_external]">
This is NOT a goal. And replace them with ...
<a href="http://[something_external]" target="_blank">
Thus, the criteria for the link to be changed:
- The href value begins with "http: //"
- Href value does not contain "ourdomain.com"
- not specified value
For example, I found the following online, but this is not entirely correct:
REReplaceNoCase(mystring, '(<a href="http://[^"]+")>', '\1 target="_blank">', 'ALL')
Make sense? Doable?
source share