I was wondering how I would write a regex expression which says 'and NO whitespaces'.I need to implement this into the following if statement, see below:
$('#postcode').blur(function(){
var postcode = $(this), val = postcode.val();
if((val.length >= 5) && (*******)){
postcode.val(val.slice(0, -3)+' '+val.slice(-3)).css('border','1px solid #a5acb2');
}else{
$(this).css('border','1px solid red');
}
});
Any help is greatly appreciated, Thanks