Skip to content

Instantly share code, notes, and snippets.

@Irio
Created June 13, 2012 14:06
Show Gist options
  • Save Irio/2924290 to your computer and use it in GitHub Desktop.
Save Irio/2924290 to your computer and use it in GitHub Desktop.
twitter username regex
# twitter_link = https://twitter.com/#!/irio
# twitter_link = https://twitter.com/#!/irio/
# twitter_link = https://twitter.com/irio/
# twitter_link = https://twitter.com/irio
"@" + /twitter.com\/(#!\/)?(.[^\/]+)/.match(twitter_link)[2] # => "@irio"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment