in reply to Kill the color escapes

Since you're only matching a single character at the end, you don't actually need non-greedy matching. You can used a negated character class instead. s/\e\[[^m]+m//g;