Homesite Regular Expressions Replace

January 21, 2003 by  
Filed under Tips and Tutorials

Thanks to the Macromedia Homesite Forums, I learned how to mass replace using regular expressions! It’s pretty easy too, the basic stuff at least.

First open Homesite, click on Search, then Extended Replace

regular expressions

regular expressionsA simple regular expression would be to replace a tag in quotes. For example, you have align=”left”, align=”right” in your HTML document, but would like for them to be replaced with align=”center”.

To do this, you can use the regular expression:

align=”[^"]*”

and replace it with:

align=”center”

This would replace any characters within the quotes with ‘center’.

To do this in Homesite, in the Extended Replace box, put the regular expression into the Find what textbox and what to replace it with in the Replace with textbox. Make sure Regular Expressions is also checked. Then click Replace.

Simple right? I’m sure there are more regular expression tricks, but this simple one is really helpful for me now.

Note: There is one small bug with regular expressions in Homesite 5. You have to replace the regular expression with ‘something’ rather than leaving it blank. That’s the only small thing I noticed.

Related Posts Plugin for WordPress, Blogger...
  • http://www.pollenation.net Tim Parkin

    Thanks for your post… I still use homesite and think it’s a great editor.. yet to find it’s equal

  • http://www.pollenation.net Tim Parkin

    Thanks for your post… I still use homesite and think it’s a great editor.. yet to find it’s equal

  • Pingback: apakuni.com » Cleaning Up Old Drafts