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 - Redis Error 8 connecting localhost:6379. nodename nor servname provided, or not known -

python - matpltolib navigation toolbar edit curves and parameters line color automatically changes issue -