I am using URI module in ruby to match a URL.
require 'uri'
url = URI"http://matchme.projects.foo.com"
Need to match the matchme part of the url and put it into a variable. The matchme part of the url will always be after http:// and before the next “.projects”.
I am trying url.scheme which gives me “http”, how to proceed from there and match my string.
The matchme part keeps changing all the time.
you can use regular expression like
or
if request object is available then
will give you the deepest sub domain.