Replacing Blank Lines in SQL Server 2005 Management Studio Queries

Here is a regular expression that works in SQL Server Management Studio. It will replace those bothersome blank lines that the query window picks up when pasting text from an HTML source.

^:b*$\n

Do a Find and Replace (or Ctrl-h)
Select Search hidden text
Select Use Regular expressions
Put ^:b*$\n in the Find what: box
Make sure Replace with: is blank
Click on the Replace All button



Google