ruby - How to get domain from URL without using URI Parser. I want to done it using regex -


i'm trying write regular expression returns domain url. example:-

"http://github.com" # => 'github' 

i'd go @arup rakshit's solution. if want regexp, why not using

/^http:\/\/(.+)\.[a-z]{2,3}/ 

Comments

Popular posts from this blog

python 2.7 - Chat Solution for Mobile App -

jquery - Detect current Section with javascript -