/** * @return {boolean} */ function IsCard(str) { var reg = /(^d{15}$)|(^d{18}$)|(^d{17}(d|X|x)$)/; return reg.test(str); }