Click to See Complete Forum and Search --> : i need help regarding ssn validation


mounica
10-22-2003, 05:36 PM
Hi i am new to javascript. one day i saw code for SSN validation but i couldn't understand that code. I am writing that code over here. Can you explain me what is that.
var matchArr = ssn.match(/^(\d{3})-?\d{2}-?\d{4}$/);
I have one java script book. I searched in that book. I didn't find any thing.
i didn't understand what is d{3}, d{2},d{4}.
What is the purpose of all those. It may be simple question.But please answer to my question. Thanks

Khalid Ali
10-22-2003, 07:51 PM
Thats regular expression...do a google search for

regular expression tutorials

and you will get the answer.

Charles
10-22-2003, 08:43 PM
Or see http://devedge.netscape.com/library/manuals/2000/javascript/1.3/guide/regexp.html.