Reputation: 409
For example, we have the following regex:
/^[a-z]{1,10}-[0-9]{10}$/
This regex allows us to enter a maximum of 21 characters.
Is there an easy way to get number of maximum allowed characters in JavaScript?
Upvotes: 3
Views: 135
Reputation: 4382
No, you can't.
If you use "?" or "+" or "*" you can't guess how many characters will match.
Upvotes: 2