Skip to content

Commit

Permalink
Validate Finnish mobile phone numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
simison committed Feb 4, 2016
1 parent fd77218 commit 84fbd0a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion test/validators.js
Original file line number Diff line number Diff line change
Expand Up @@ -1612,17 +1612,22 @@ describe('Validators', function () {
validator: 'isMobilePhone'
, valid: [
'+358505557171'
, '0455571'
, '0505557171'
, '00358505557171'
, '04412345'
, '0457 123 45 67'
, '019123456789'
, '+358457 123 45 67'
, '+358 50 555 7171'
]
, invalid: [
'12345'
, ''
, '045557'
, '045555717112312332423423421'
, 'Vml2YW11cyBmZXJtZtesting123'
, '010-38238383'
, '+3-585-0555-7171'
, '+9676338855'
, '19676338855'
, '6676338855'
Expand Down
2 changes: 1 addition & 1 deletion validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
'nn-NO': /^(\+?47)?[49]\d{7}$/,
'vi-VN': /^(0|\+?84)?((1(2([0-9])|6([2-9])|88|99))|(9((?!5)[0-9])))([0-9]{7})$/,
'en-NZ': /^(\+?64|0)2\d{7,9}$/,
'fi-FI': /^((90[0-9]{3})?0|00358|\+358\s?)(?!(100|20(0|2(0|[2-3])|9[8-9])|300|600|700|708|75(00[0-3]|(1|2)\d{2}|30[0-2]|32[0-2]|75[0-2]|98[0-2])))(4|50|10[1-9]|20(1|2(1|[4-9])|[3-9])|29|30[1-9]|71|73|75(00[3-9]|30[3-9]|32[3-9]|53[3-9]|83[3-9])|2|3|5|6|8|9|1[3-9])\s?(\d\s?){4,19}\d$/
'fi-FI': /^(00358|\+358|0)\s?(4|40|41|42|44|45|50)\s?(\d\s?){4,8}\d$/
};

// from http://goo.gl/0ejHHW
Expand Down

0 comments on commit 84fbd0a

Please sign in to comment.