+ return "Discover card"
+ if $number =~ /^30[0-5x][\dx]{13,16}$/o #diner's: 300-305, 30x
+ || $number =~ /^309[5x][\dx]{12}$/o # 3095, 309x
+ || $number =~ /^36[\dx]{12,17}$/o # 36
+ || $number =~ /^3[89][\dx]{14,17}$/o # 38 and 39
+ || $number =~ /^60[1x]{2}[\dx]{12,15}$/o #discover: 6011 601x 60xx
+ || $number =~ /^64[4-9x][\dx]{13,16}$/o # 644-649, 64x
+ || $number =~ /^65[\dx]{14,17}$/o # 65
+ || ( $number =~ /^62[24-68x][\dx]{13,16}$/o && $Country =~ /^(US|MX|AI|AG|AW|BS|BB|BM|BQ|VG|KY|CW|DM|DO|GD|GP|JM|MQ|MS|BL|KN|LC|VC|MF|SX|TT|TC)$/oi ) #China Union Pay identified as Discover in US, Mexico and Caribbean
+ || ( $number =~ /^35(2[89x]|[3-8][\dx]|xx)[\dx]{12,15}$/o && $Country =~ /^(US|PR|VI|MP|PW|GU)$/oi ); #JCB cards in the 3528-3589 range are identified as Discover in US, Puerto Rico, US Virgin Islands, Northern Mariana Islands, Palau and Guam
+
+ return "Switch"
+ if $number =~ /^49(03(0[2-9]|3[5-9])|11(0[1-2]|7[4-9]|8[1-2])|36[0-9]{2})[\dx]{10}([\dx]{2,3})?$/o
+ || $number =~ /^564182[\dx]{10}([\dx]{2,3})?$/o
+ || $number =~ /^6(3(33[0-4][0-9])|759[0-9]{2})[\dx]{10}([\dx]{2,3})?$/o;
+ #redunant with above, catch 49* that's not Switch
+ return "VISA card" if $number =~ /^4[\dx]{12,18}$/o;