SERVER-8217 Better fix for regex