pattern check script