I have a URL string:
http://localhost:3000/user/event?profile_id=2&profile_type=UserProfile
I want to extract "2" and "UserProfile", where these can change.
I tried to use both match and scan but neither is returning results:
url = "http://localhost:3000/user/event?profile_id=2&profile_type=UserProfile"
m = /http(s)?:\/\/(.)+\/user\/event?profile_id=(\d)&profile_type=(\w)/.match(url)
=> nil
url.scan /http(s)?:\/\/(.)+\/user\/event?profile_id=(\d)&profile_type=(\w)/
=> []
Any idea what I might be doing wrong?