pattern check