Validating Social Media Handles

Using RegEX to validate the handles for each social media platform

Twitter

Characters allowed are alphabets, numbers, or underscores (maximum 15 character)

/^[a-zA-Z0-9_]{1,15}$/

Instagram

Characters allowed are alphabets, numbers, underscores, and periods (maximum 30 character)

/^[a-zA-Z0-9_.]{1,30}$/

Facebook

Characters allowed are alphabets, numbers, and periods (maximum 75 character)

/^[a-zA-Z0-9.]{1,75}$/

Snapchat

Characters allowed are alphabets, numbers, underscores, dashes, and periods (maximum 15 character)

/^[a-zA-Z0-9._-]{3,15}$/

Last updated