January 23, 2009 10:03 pm GMT
Cleaning up unnecessary linebreaks in Dreamweaver
by Gary IllyesSo, there has to be a better way to clean up the code, an automation or macro maybe.
And there is. What we will do is to search with a regular expression for multiple blank lines then replace each with “\n” aka one single line.
So here are the steps you have to follow:
- From the Edit menu choose Find and Replace, or press Ctrl+F
- The Find in field and the Search fields should be Current Document respectively Source Code
- Check the Use Regular Expression box
- In the Find box copy paste the following regular expression
[\r\n]{2,} - Lastly, in the Replace field type \n and press Replace all
As a little help, here’s a screen-shot how the search box should look like:
Hope this info will help you as it helped me.


















mailinator on Fri, 24th Apr 2009 7:54 am
Find and replace with regular expressions in DW
\s*Replace with"Notice there is a space after the *"