use better regexp matching in tag stats, closes old issue 384