Reputation: 21
I need a regex test that will test a field of 4 digits making sure at least one of the 4 digits is non-zero. Example:
abcd0000efgh - fail
abcd0001efgh - pass
abcd0010efgh - pass
abcd0100efgh - pass
abcd1000efgh - pass
abcd1234efgh - pass
abcd4321efgh - pass
Thanks
Upvotes: 2
Views: 855
Reputation: 87783
What flavor/language?
Here is the initial answer before having more information.
(?!0{4})\d{4}
Upvotes: 9