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

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -