skynyrd
2/13/2017 - 8:22 AM

Common regex strings

Common regex strings

  • Address Validator: Allow only letters, numbers and some characters (_ , / # : & + -) (Enter is not allowed)
^[ A-Za-z0-9_.,\/#:&+-]*$
  • Address Validator: Allow only letters, Turkish characters, numbers and some characters (_ , / # : & + -) (Enter is not allowed):
^[ A-Za-z0-9ğüşöçİĞÜŞÖÇ_.,\/#:&+-]*$
  • Turkish phone number, starting with 5 and 10 characters total:
^5[0-9]{9}$
  • General purpose phone number (Starts with optional + character, must include numbers length of 6-14, allows space (\x20)):
^\+?(?:[0-9]\x20?){6,14}[0-9]$
  • GUID Validator:
^\b[A-F0-9]{8}(?:-[A-F0-9]{4}){3}-[A-F0-9]{12}\b$
  • MERSIS No:
^\d{16}$
  • Email:
^([0-9a-zA-Z]([\+\-_\.][0-9a-zA-Z]+)*[\-_]?)+@(([0-9a-zA-Z][-\w]*[0-9a-zA-Z]*\.)+[a-zA-Z0-9]{2,17})$
  • Password Validator rules:
8 - 16 char  should not less then 8 character and more than 16 character
(?=.*[a-z])  should contain lower case letter
(?=.*[A-Z])  should contain upper case letter
(?=.*[0-9])  should contain number
(?=.*[$-/ | :-? | {-~ | ! | " | ^ | _ |` | \[ | \]]) should contain any character below
                                                     $, %, &, ', (, ), *, +, -, ., /,
                                                     :, ;, <, =, >, ?, {, |, }, ~, !, ",
                                                     ^, _, `, [, ], @, #
^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[$-/ | :-? | {-~ | ! | @ | # | " | ^ | _ |` | \[ | \]])^[a-zA-Z0-9$-/:-?{-~!@#"^_`\[\]]{8,16}