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 - matpltolib navigation toolbar edit curves and parameters line color automatically changes issue -

node.js - Nodejs javascript implementation of PBEWithMD5AndTripleDES/CBC/PKCS5Padding -