Let’s say I have a column “URL” which consists of URL paths. e.g. “https://community.looker.com/topic/new?fid=10”, “https://community.looker.com/groups/data-explorers-guild-1012” etc..
How can I use regex extract to take whats before the last “/” and after the one before.
From the top two respectively, I would ideally be extracting “topic”, ”groups”..
Solved! Go to Solution.
What database are you using?
If using Redshift for example and the URLs are consistent you could use SPLIT_PART(string,delimiter,part)
SPLIT_PART(URL,’/’,4) should return topic in the first example.
What database are you using?
If using Redshift for example and the URLs are consistent you could use SPLIT_PART(string,delimiter,part)
SPLIT_PART(URL,’/’,4) should return topic in the first example.