Skip to content

Instantly share code, notes, and snippets.

@thaycacac
Created January 9, 2019 03:06
Show Gist options
  • Save thaycacac/76179acb59f76e7c24f9b5dff9451643 to your computer and use it in GitHub Desktop.
Save thaycacac/76179acb59f76e7c24f9b5dff9451643 to your computer and use it in GitHub Desktop.
Note Regex

Độ mạnh của mật khẩu

^(?=.*[A-Z].*[A-Z])(?=.*[!@#$&*])(?=.*[0-9].*[0-9])(?=.*[a-z].*[a-z].*[a-z]).{8}$

Xác thực email

/[A-Z0-9._%+-]+@[A-Z0-9-]+.+.[A-Z]{2,4}/igm

Xác thực số điện thoại

^\+?\d{1,3}?[- .]?\(?(?:\d{2,3})\)?[- .]?\d\d\d[- .]?\d\d\d\d$

Xác thực ngày trong định dạng DD/MM/YYYY

^(?:(?:31(\/|-|\.)(?:0?[13578]|1[02]))\1|(?:(?:29|30)(\/|-|\.)(?:0?[1,3-9]|1[0-2])\2))(?:(?:1[6-9]|[2-9]\d)?\d{2})$|^(?:29(\/|-|\.)0?2\3(?:(?:(?:1[6-9]|[2-9]\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00))))$|^(?:0?[1-9]|1\d|2[0-8])(\/|-|\.)(?:(?:0?[1-9])|(?:1[0-2]))\4(?:(?:1[6-9]|[2-9]\d)?\d{2})$

Url trang facebook cá nhân

/(?:http:\/\/)?(?:www\.)?facebook\.com\/(?:(?:\w)*#!\/)?(?:pages\/)?(?:[\w\-]*\/)*([\w\-]*)/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment