Skip to content

Instantly share code, notes, and snippets.

@bulatie
Last active July 11, 2019 08:19
Show Gist options
  • Save bulatie/fc86ae7f77d020acea82f6e1465548c3 to your computer and use it in GitHub Desktop.
Save bulatie/fc86ae7f77d020acea82f6e1465548c3 to your computer and use it in GitHub Desktop.
regex
var fileOrPath = /^((((?:\.\/|\.\.\/|\/)?(?:[.\w-_]+\/)*)([.\w-_]+)*),?)+$/
var email = /^[a-z0-9]+([._\\-]*[a-z0-9])*@(?:(?!qq|gmail|163|sina|live|126|yeah|sohu|hotmail|outlook|263|googlemail|yahoo|sogou|21cn|189|aliyun|foxmail|139|10086)[a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/
var phone = /^1\d{10}$|^(0\d{2,3}-?|\(0\d{2,3}\))?[1-9]\d{4,7}(-\d{1,8})?$/
var hexstring = /\b[0-9a-fA-F]+\b/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment