Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

scanning cfm file for href's 1

Status
Not open for further replies.

MarcDePoe

Programmer
Dec 19, 2000
101
US
I need to replace all the hrefs in a file.
for example:

turn
<a href=&quot;something.com&quot;>
into
<a href=&quot;somethingelse.com&quot;>

no matter where the hrefs point, I need to point them all somewhere else.

Can anyone help?
 
i would do this in jscript ! is this fine for you ? if so, just tell me which browser you're targetting, because the code could slightly change

 
Another way to do it is to use ColdFusion Regular Expressions. Read the page via CFHTTP, store it in a variable and scan this variable for HREF's with a Regular expression. Once you've replaced all the links, present the page. <webguru>iqof188</webguru>
 
Yes, Regular Expressions work.

If this is &quot;maintenance&quot; work on your site, i suggest evaluating UltraEdit. The built in RE editor will recursively replace all your &quot;This.com/&quot; with &quot;that.com&quot; in seconds, then just upload the site : )

A little more info on Regular Expressions:

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top