-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
fix(isMobilePhone): Add mobile phone validation locale for Moldova #1918
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1918 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 102 102
Lines 2072 2072
Branches 472 472
=========================================
Hits 2072 2072
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks fine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
Wrong. Regexp not correspond to mobile phone! Test set valid: [ The +373(22)56-03-50 is not mobile number |
I pulled all the valid phone numbers from this phone number generator site. From what I was able to tell from that, and various formats for Moldova numbers I found online it seemed correct. I just made the regex so that the number didn't require parenthesis to be valid. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution; see if you can address my comment below.
'ro-RO': /^(\+?4?0)\s?7\d{2}(\/|\s|\.|\-)?\d{3}(\s|\.|\-)?\d{3}$/, | ||
'ru-MD': /^(\+373)(\/|\s|\.|\-|\()?\d{2,3}(\/|\s|\.|\-|\))?\d{1,2}(\/|\s|\.|\-|)?\d{2}(\/|\s|\.|\-|\()?\d{2}$/, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd never noticed this a alias,
could we just do ..['ru-MD'] = ..['ro-MD']
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like you would have to have the ..['ru-MD'] = ..['ro-MD']
outside the definition of the validator (see here), which could be messy with it having to be assigned outside the dict.
fix(isMobilePhone): Add mobile phone validation locale for Moldova(ro-MD, ru-MD)
Closes #1915
Checklist