How do I write a regex that says, if word/string starts with the letters ‘BT’?
Here’s the code I working with:
if(val.match(/^\S{5,}$/)){
if(val.match(/^BT/)){
alert('Unfortunately you cannot buy or sell registrations in the Auctions if you live in Northern Ireland');
return false;
}else{
postcode.val(val.slice(0, -3)+' '+val.slice(-3));
$('#Postcodelookup').fadeIn(300);
}
}else{...
Any help would be appreciated as I’m quite new to using regex, Thanks
You want
/\bBT/.