Regular expression for Less or more than 9 digits Repeating digits for first 5 or all 9 digits and only number?

5.6k Views Asked by At

I have this

"^(?!(11111|22222|33333|44444|55555|66666|77777|88888|99999|00000))([0-9]\d{8})" 

regular expression in c# code and javascript works fine but in text tag of adobe echosign doesnt works anyone have anotherway to work on texttag of echosign?

1

There are 1 best solutions below

4
On

By your last comment, you need a regex to validate a string of maximum length 9 containing digits only:

^[0-9]{1,9}$

This will validate any string containing digits, with length at least 1 and not greater than 9.

If you want to avoid strings such as 098 (leading zeroes), use this instead:

^[1-9][0-9]{0,8}$

EDIT: If I understand your question well now, you can use this regex:

^(?!([0-9])\1\1-\1\1)[0-9]{3}-[0-9]{2}-[0-9]{4}$

That is assuming that echosign can handle callbacks, if not, you can use this instead:

^(?!(?:111-11|222-22|333-33|444-44|555-55|666-66|777-77|888-88|999-99|000-00))[0-9]{3}-[0-9]{2}-[0-9]{4}$