Last time I was asked for checking string for minimum 8 digits. And I got following regex:
/^(?=(.*\d){8,})[\d\(\)\s+-]{8,}$/
You can see the question here: Checking string with minimum 8 digits using regex
Now I want to restrict string to accept maximum 14 digits in same regex. And I tried this:
/^(?=(.*\d){8,14})[\d\(\)\s+-]{8,}$/
No luck. Please anyone help me in fixing this.
UPDATE
After getting 2 down votes I thought better to write my own. I constructed regex using previous regex. Following regex works for me:
/^(?=(.*\d){8})(?!(.*\d){15})[\d\(\)\s+-]{8,}$/