fix(isMobilePhone): Add mobile phone validation locale for Moldova#1918
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.
|
|
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. |
profnandaa
left a comment
There was a problem hiding this comment.
Thanks for your contribution; see if you can address my comment below.
| 'pt-AO': /^(\+244)\d{9}$/, | ||
| 'ro-MD': /^(\+373)(\/|\s|\.|\-|\()?\d{2,3}(\/|\s|\.|\-|\))?\d{1,2}(\/|\s|\.|\-|)?\d{2}(\/|\s|\.|\-|\()?\d{2}?$/, | ||
| '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.
I'd never noticed this a alias,
could we just do ..['ru-MD'] = ..['ro-MD']?
There was a problem hiding this comment.
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