Find and Replace code using Wild cards in Dreamweaver

Let’s say, you are in a common situation when you have to search and replace some links in hundred or even thousand of web pages. You are using Dreamweaver. In CodA (Mac) there is a simple command, to use wild cards, at an one click distance, but in Dreamweaver? Oh, well, since you can’t get any help even from Dreamweaver help I bet you’re thirsty to know.

Situation:
You want to search and replace all the links of your website from this:

<a href="http://www.kensfi.com/history_of_coding.html"></a>
<a href="http://www.kensfi.com/tutorials_for_begginers.html></a>
<a href="http://www.kensfi.com/learning_html_in_15min.html></a>
<a href="http://www.kensfi.com/how_to_be_a_dirty_developer.html></a>
<a href="http://www.kensfi.com/CSS_tags.html></a>

to this:

<a href="#"></a>

If you don’t know yet “#” is placing a false link into the page, just to have an idea how the links are displayed on the page. You will have mouse over and all other properties like a regular link except that you won’t navigate anywhere clicking on it.

How to solve:

Search for:

<a href="[^"]*"></a>

Replace with:

<a href="#"></a>

Don’t forget to check Use regular expression (it’s under the replace box).

As you can guess already, this will replace all of your links with the desired code, in this case:

<a href="#"></a>

If you want to search and replace on more than one web page you’ll have to set this in Find in drop box, but I’m assuming you already know this.

Tags : , , , , , ,

If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.

2 Comments

Leave Comment