rob pointed out some regex bugs