Created
June 13, 2012 14:06
-
-
Save Irio/2924290 to your computer and use it in GitHub Desktop.
twitter username regex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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