if (num.match(/^(5[1-5]|222[1-9]|22[3-9]|2[3-6]|27[01]|2720)[0-9]{0,}$/)) {
return alert('MasterCard');
} else if (num.match(/^4[0-9]{0,}$/) || num.match(/^4\d{12}/)) {
return alert('Visa');
} else if (num.match(/^(5[06789]|6)[0-9]{0,}$/) || num.match(/^4\d{12}/)) {
return alert('Maestro');