Overkill use of regex

I just came across a regex when looking through the source code, and it looked so horrible, I had to fix it :) See attached commit.