Regular Expression Search in Dreamweaver
Posted on | August 27, 2009 | No Comments
During working on any static site or existing site a lot of times we face a problem that there should be search using wild characters or regular expressions.
For example I have a site at my local where a lot of links:
<a href=”../category/article-title-keyword1.html”>
We need to search all links which are in this category and need to change them in category2.
We usually does that manually i.e. we search /category/ and replace it with /category2/.
There is also another good method using regular expression.
In search box put in find box:
href=”../category/([^<]*)”>
and in replace box put:
href=”../category2/$1″>
Check box of “Use Regular Expressions” should be checked.
If you want to change in whole site than select that option. We prefer to check first in current page so that you can undo if there is something going wrong.
Explanation: ([^<]*) is like a variable. You can use more variables but you should separate them properly in search query. We can put variable value in replace box with $1, $2 etc.
Comments
Leave a Reply

