I am trying to write a regex (to validate a property on a c# .NET Core model, which generates javascript expression) to match all numbers composed by at least two different digits and a minimum length of 6 digits.
For example:
222222 - not valid
122222 - valid
1111125 - valid
I was trying the following expression: (\d)+((?!\1)(\d))
, which matches the sequence if has different digits but how can I constrain the size of the whole pattern to {6,}
?
Many thanks