I really like regexes. They can do so much work for you! Sometimes I write some to do my work for me. And then I put them here for future reference:

Bracket not in separate line:


Delete whitespaces on end of line:


Incorrect spacing around assignment/comparison:

\S[\&|+=\!\-\*<>]=\|=[^ =]

Change “//” comments into”/* */” comments:


Too long lines in C files:

grep -rP “.{81,}” `find -name ‘*.c’`