Open arghyabanerjee opened 8 years ago
Hi, I'm doing the same kind of validations and the library works well. Right now the regex you defined will succeed when it finds the pattern anywhere in the string, to match the full string you need to add start of line / end of line anchors like this:
^[0-9]{3}-[0-9]{3}-[0-9]{4}$
This is also explained in the documentation: https://github.com/daveclayton/json-schema-validator/wiki/Status#regex-support-ecma-262-and-the-real-definition-of-matching
For this regex [0-9]{3}-[0-9]{3}-[0-9]{4} format not reporting any validation exception for this format
2222-333-55555
The issue is first(2222) and last(55555) part if length is more than 3 and 4 character it's not showing any validation exception. If length is less than 3 and 4 character it's showing validation exception.
Accepting characters, Not showing any validation exception for this value 22235abcd345641-111-11199