Given string str, the task is to check whether the given string is valid SSN (Social Security Number) or not by using Regular Expression Validate Your SSN Now.
The valid SSN (Social Security Number) must satisfy the following conditions:
It should have 9 digits.
It should be divided into 3 parts by hyphen (-).
The first part should have 3 digits and should not be 000, 666, or between 900 and 999.
The second part should have 2 digits and it should be from 01 to 99.
The third part should have 4 digits and it should be from 0001 to 9999.
Examples: