Optimize the regex for parsing HTTP locale.