I have to do some regex and am restricted to a google sheet where I don't have my sweet, sweet, python string methods.
Preferred result:
I am using =REGEXMATCH()
in google sheets and want to parse URLs. For example, for the following url:
https://www.foobar.com/foo/bar
I'd like to get everything after https://
and before the first /
after the domain, like so (assume all my urls start with https://
and have extensions after the base url.
www.foobar.com
What I have tried:
I have the following formula that gets me close:
=REGEXEXTRACT(A1,"^https?:\/\/[^\/]+")
https://foobar.com
But I still need to get rid of the https://
I also tried a positive look behind assertion but to no avail:
=REGEXEXTRACT(A1,"/ (?<=https?:\/\/)[^\/]/+")
but I get an error.
Any help is appreciated!