Skip to content

Instantly share code, notes, and snippets.

@styopdev
Created October 19, 2017 11:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save styopdev/c326b577ea153f7521e7283626c5307c to your computer and use it in GitHub Desktop.
Save styopdev/c326b577ea153f7521e7283626c5307c to your computer and use it in GitHub Desktop.
Social networks profiles validation regexps
// Facebook
/((https?):\/\/)(www[.])?(mbasic.facebook|m\.facebook|facebook|fb)\.(com|me)\/(?:(?:\w\.)*#!\/)?(?:pages\/)?(?:[\w\-\.]*\/)*([\w\-\.]*)/ig,
// LinkedIn
/((https?):\/\/)(www[.])?linkedin\.com\/(in|company|groups)\/.?\/?.?\/?([0-9]*)/,
// Google+
/((https?):\/\/)(www[.])?plus\.google\.com\/u\/.?\/?.?\/?([0-9]*)/,
// Twitter
/((https?):\/\/)(?:www\.)?twitter\.com\/([a-zA-Z0-9_]+)/,
// IMDb
/(http:\/\/)(www[.])imdb\.com\/.?\/?.?\/?([0-9]*)/,
// YouTube
/((https?):\/\/)(www[.])?youtube\.com\/(channel\/|user\/)[a-zA-Z0-9\-]{1,}/,
// Vimeo
/((https):\/\/)(www[.])?vimeo\.com\/user.?\/?.?\/?([0-9]*)/,
// Website
/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.([a-z]{2,6}){1}/,
// Blog
/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.([a-z]{2,6}){1}/,
// Other
/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.([a-z]{2,6}){1}/,
// Instagram
/https?:\/\/(www\.)?instagram\.com\/([A-Za-z0-9_](?:(?:[A-Za-z0-9_]|(?:\.(?!\.))){0,28}(?:[A-Za-z0-9_]))?)/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment