I\'m trying to detect a pattern that has three parts:
I
Space or end of line? Use |:
|
s/ \([mt]\)\( \|$\)/\1\2/g