What you wrote doesn't work for two reasons. First, you have an extra " " in your regexp, so you're requiring that the fields contains double quote, space, double quote. If you fix that, you get /[a-zA-Z0-9][a-zA-Z0-9][a-zA-Z0-9][a-zA-Z0-9]/, which matches a field that contains at least four ASCII letters or digits, but may contain more, so it will match Elizabeth as well as John, but not Tom. You can write /^[a-zA-Z0-9][a-zA-Z0-9][a-zA-Z0-9][a-zA-Z0-9]$/ to anchor the regexp at the start and end, but if what you're after is the length of the field, just write that.