change equality check to regexp