Regex

This document contains explanation on how email and mobile phone number are validated.

Validation is using regEx (Regular expression) for validating phone number and email.

  • Mobile number regex ^\+?(([0-9]+)([\-\. ]?))*([0-9]+)$ Very simple controll. Basically, any number
  • Number must have at least one digit.
  • Can start with an optional + sign followed by a mandatory digit.
  • Number can have any combination digits between 0-9.
  • Number can only have one consecutive appearance of the characters -.[space].
  • Number must end with a digit.i.e 0-9.


  • Example of valid mobile number
    • +46 70 456 23 00
    • 46 70.45 6-23-00
    • 19059031899
    • 023-704526


  • Invalid number
  • -070 45 45 45
  • 070--45 45 45
  • 070 45 45 45-


  • Email regex [a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])? This regex is more complicated but basically allows any email address. Email validation as per RFC2822 standards.
  • Before the domain name any charater and the last character befor the domain name must be an @ sign.
  • After the last @ the adress can only have english character and number a-z and 0-9.


  • Example of valid email
  • เกิน.Östermalme@gmail.se (Thai)
  • 干杯.Östermalme@gmail.se (Chineese)
  • hello@momentum.se (English)
  • Über.Jænsen@momentum.se (German/Danish/English)