I am trying to perform a few check but REGEX I just don't get the hang of. I am trying to check firstly for 3 characters and secondly want to perform a check that there are no numeric characters. The code is below and finally could some one answer is the regex syntax same in every language?
$(document).ready(function() {
var name=$('#firstname');
function validateName() {
//function nameCheck() {
if (name.val().length <=2) {
name.addClass('error');
$(".hidden_f").html("First Name must be 3 letters!");
} else if ($("#firstname.").val().match('[a-z]')) {
$(".hidden_f").html("No numbers!");
}
}
name.keyup(validateName);
});
And also if possible could some one give me a few examples so I can try and learn regex cheers!