You are here

Removing trailing whitespace in Eclipse

Submitted by Druss on Sun, 2007-06-24 17:30

I suck at regex. But the fact that Eclipse leaves trailing whitespace everywhere is pretty fucking annoying. Although, this will apparently be solved in 3.3, that's still a month or so away (IIRC). Anyways, while I normally just use a   $ regex search (whitespace switches don't like working in Eclipse's find dialog) to repeatedly weed out the bastards, today, I came across a more robust expression. Here goes:

Find: [\t ]+(?:(\n)|$)
Replace: $1

and Jesus wept (with joy).