I\'m trying to add a macro/command to Textmate for some file cleanup and the last tidbit I haven\'t figured out is simply to remove blank lines from the beginning and end of a f
This regex will remove the whitespace at the beginning of the file
Find ^[\r\n\t ]+
and replace with (nothing).
And this one will remove the whitespace at the end
Find [\r\n\t ]+$
and replace with (nothing).
I've never used Textmate regular expressions. There can be a \s
(whitespace) class you can use instead of [\r\n\t ]
. Also, you might need to turn multi-line mode on, if there is one.