add regex common code