Home > Software engineering >  regex turkey phone number
regex turkey phone number

Time:12-29

I am using the following expression for the mobile phone rule in google workspace. But this expression also includes landline phones. How do I prevent this? Also google workspace does not use this term "^" used at the beginning of the expression.

Mobile: 05xx xxx xx xx Landline: 02xx xxx xx xx

\(?\ ?(\d{2})?[ -]?([05] \d{2})\)?[ -]?(\d{3})[ -]?(\d{4})?[ -]?(\d{2})[ -]?(\d{2})

CodePudding user response:

(^05\d{2})(\s|-)?(\d{3})(\s|-)?(\d{4})

CodePudding user response:

You may use the following regex pattern:

^05\d{2}[ -]?\d{3}(?:[ -]?\d{2}){2}$
  • Related