On Sep 21, 2006, at 7:50, Jacob Haller wrote:
How can I remove trailing spaces in the document? I think that this should be essential feature included in BBEdit, via menus, and maybe also included in preferences, to be able to select it to strip trailing spaces automatically upon saving the file.

Find ' +$' (a space followed by +$) and replace with nothing.

That'll find the spaces at the end of lines, but I think the OP was looking to kill trailing white spaces from the end of the *document*. In that case, this should do the trick:

Search for: \s*\z
Replace with: [leave blank]

To explain:

\s -> matches any whitespace character (spaces, tabs, returns, etc.)
* -> finds a series of zero or more instances of the preceding pattern (\s)
\z -> The series must be at the very end of the document


Regards,
Bob

--
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
If so, please send mail to <[EMAIL PROTECTED]>, not to the list.
List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml>
List archives: <http://www.listsearch.com/BBEditTalk.lasso>
To unsubscribe, send mail to:  <[EMAIL PROTECTED]>

Reply via email to