JS игнорировать дело
var str = "Visit W3Schools!";
var patt1 = /W3S/i;
var res = patt1.ignoreCase
Vast Vulture
var str = "Visit W3Schools!";
var patt1 = /W3S/i;
var res = patt1.ignoreCase
function sameCase(str) {
return /^[A-Z]+$/.test(str) || /^[a-z]+$/.test(str);
}