2

I have a list of URLs in an event action field, and need to extract only the domain name (without TLD) using Data studio:

https://example.com => example
https://www.example.com => example
https://subdomain.example.com => example

Managed to extract everything but the non www version with this:

REGEXP_EXTRACT(Event Action, '^[^.]+.([^.]+)')

Any ideas how extract the non www version as well? Appreciate any help.

1 Answer 1

2

This does the trick (Created a Google Data Studio Report (Google Sheets Embedded) to demonstrate):

REGEXP_EXTRACT(Event Action, "(\\w+)\\.\\w+$")

2]

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.