making the regex tighter / eliminating unnecessary cases