I'm validating SSN numbers with the format***-**-**** . If the user enters all the same digits (e.g., 000000000 or 111111111), or if the first three digits are 000 or 999, an error will be displayed. Only hyphens are allowed as special characters."
Hi Pratik,
starting you can use javascript regular expressions, /^\\d{3}-\\d{2}-\\d{3}$/, this will check for the right format.
For the other part, select the first 3 values and check with == if its equal or not.
Hope it helps you, regards.
What you could do is get the substring based on "-" and compare each character of these individuals parts with the first characters and any one is different then it's a valid SSN. Attached a reference implementation assuming the string is precisely 11 characters and in the format is ***-**-****.
Hi Pratik,Refer the below link & implement it using javascript.https://www.geeksforgeeks.org/how-to-validate-ssn-social-security-number-using-regular-expression/
RegardsKrishnanand Pathak
Hi @Pratik dhole
I think the regular expressions provided in the link are not working properly.
I have attached the OML. I believe it is functioning properly.
Regards,
Rishabh Chawda