New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
small regex bug in number check #41
Comments
I have this problem as well. Makes for poor usability. Can this get added soon? |
Agreed. I was about to file a bug for this myself. See http://goo.gl/eXr1D and http://goo.gl/Kap25 for the before and after test cases. |
I have a pull request on this issue with the fix set as what @bentrombley specified as the fix. |
I agree. Please fix. |
Okay, I'll work on figuring it out. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Validator with {number: true} rejects floats without the leading 0 (e.g. ".3").
Current version and fixed version respectively (line 1022):
return this.optional(element) || /^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:.\d+)?$/.test(value);
return this.optional(element) || /^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:.\d+)?$/.test(value);
-Ben
The text was updated successfully, but these errors were encountered: