I’m working on converting a web site from tables and old fashioned tags to CSS and semantic page structure. And I thought to myself, wouldn’t it be nice if I could easily do a ‘Find and Replace’ in Dreamweaver or Homesite, where I can determine the starting tag and ending tag, with the text in the middle acting like a variable.
So I asked my friend if he knew of a way to do that, and with his help we figured it out using regular expressions. Here’s the breakdown…
In the dialog box, this text goes in the ‘Find’ field:
And this in the ‘Replace’ field:
You need to make sure that the ‘Regular Expressions’ checkbox is CHECKED. The text between the tags in the examples above are the regular expressions.
If you want to have more than one “variable”, then you’ll need to add on numbers in the replace field, like this…
<div style="padding-bottom: 5px; margin-top: 30px;" class=subtitle><a
Replace field (number each variable):