scarhand Posted September 16, 2010 Share Posted September 16, 2010 need to test to see if "field" is formatted as NN-NN-NN where N = a digit heres my code: /\d{2}-\d{2}\d{2}/.test(field) == false doesn't seem to work. Quote Link to comment Share on other sites More sharing options...
scarhand Posted September 16, 2010 Author Share Posted September 16, 2010 got it. /^(\d){2}-(\d){2}-(\d){2}$/ Quote Link to comment Share on other sites More sharing options...
Psycho Posted September 16, 2010 Share Posted September 16, 2010 Since it is only two digits grouped together I would just do the following for clarity /^\d\d-\d\d-\d\d$/ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.