Useful sed(1) regular expressions

• 本文约 77 字,阅读大致需要 1 分钟 | Development

Source code cleanup:

sed -i '' -E s/\ \	/\	/g *.c *.h
sed -i '' -E s/^\ \ \ \ \ \ \ \ /\	/g *.c *.h
sed -i '' -E s/\	\ \ \ \ \ \ \ \ /\	\	/g *.c *.h
sed -i '' -E s/\ +\$//g *.c *.h

Subsistitue / with \/:

sed -i '' -E s/\\\//\\\\\\\\\\\\\\\//g

Just joking… No, nobody will ever try to use the above command :-)