Extract usernames from the link

Hey,

I have a table of customers of my online store consisting of around thousands of records. In that I have one column with all the account links like (https://www.domain.com/username1) and so I want to put all the usernames (username1) in a separate column. I don’t have much idea around using REGEX , can anyone from this community tell me what should be the exact formula for that?

Maria

Hello Maria, please try this REGEX formula below:

REGEX_EXTRACT({URL}, ‘^(?:https?://)?(?:www.)?(?:website.com)?/?([^/\s]+)’)

Please learn more about REGEX Formulas in this guide. We’ve also added a quick video tutorial on how it works.

Thanks,
Rachit