Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Extract Match URL in data studio

I am trying to get specific part of a url from my website in data studio. This is the url type:

https://mywebsite.com/acs/region/USA/news/asdf.com
https://mywebsite.com/acs/region/ARG/news/asdf2.com
https://mywebsite.com/acs/dtcp/en-us/news/asdf3.com

And I would like to get:

region/USA
region/ARG
dtcp/en-us/

This is the code that I tried it:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

/[a-zA-Z]+/[a-zA-Z]+/

But in data studio print NULL.

>Solution :

You can use

/acs/([^/]+/[^/]+)/

See the regex demo. Details:

  • /acs/ – a literal string
  • ([^/]+/[^/]+) – Group 1: any one or more chars other than /, / and then again one or more chars other than /
  • / – a / char
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading