Forum Moderators: open
Example:
This:
<a href="filename.wav">
needs to be replaced with this:
<a href="http://www.mysite/wavs/filename.wav">
How do I exclude the "filename.wav" and do a find & replace to add the URL before the filename?
Wildcards?
<a href="filename.wav">
in the 'find' box, and then put
<a href="http://www.mysite/wavs/filename.wav">
in the 'replace' box. DW will find all instances of the first and replace them with the second.
This will work great if you only have a few files to change the links over, but for hundreds of files you should probably use Regular expressions. DW help has a pretty good description of what you want to do. What you'll probably need to do is:
first make sure the 'Use Regular Expression' box is selected and make sure you have 'search' set to source code
second put your search phrase in the find box using regular expressions. In your case, that will come out probably looking something like this:
<a href="(.*)\.wav">
then you put the replacement phrase in:
<a href="http://www.mysite/wavs/$1.wav">
I haven't tested this, but I think it would work in theory. Test is out on a page and if it has the desired results then you can do a site wide search and replace. Before doing that, I recommend doind a find all first so you make sure that you aren't changing something you didn't want to.