Regular Expressions 101

Community Patterns

Finnish Mobile Number Validation

1

Regular Expression
PCRE (PHP <7.3)

/
^((04[0-9]{1})(\s?|-?)|050(\s?|-?)|0457(\s?|-?)|[+]?358(\s?|-?)50|0358(\s?|-?)50|00358(\s?|-?)50|[+]?358(\s?|-?)4[0-9]{1}|0358(\s?|-?)4[0-9]{1}|00358(\s?|-?)4[0-9]{1})(\s?|-?)(([0-9]{3,4})(\s|\-)?[0-9]{1,4})$
/
gm

Description

Checks for valid Finnish mobile numbers, takes in to account possible operator codes, different ways of marking country code if supplied and allows for hyphens and spaces in places where they are commonly used.

Submitted by anonymous - 6 years ago