I need to validate a string of number for non repeating numbers and a count match in JavaScript using regex
Use case :
- The string should have only numbers.
- The string should only be of length 9
- The string should not have two same numbers
Example :
123456789 should be valid
123456788 should be invalid - Same number not allowed twice
12345678 should be invalid - Doesn't have 9 numbers
1234567890 should be invalid - Has more than 9 numbers
I used below code to find a count match but don't know how to check for non repeating numbers
/(^\d{9}$)/