Reputation: 21
I wondered if anyone could help me, I'm trying to pull the content after "en" and only between the following brackets /en/[here]/ so in the below example, it should return "about".
/content/web/gx/en/about/analyst-research/archive/market
All the URLs have the same pattern at the beginning (i.e. /content/web/gx/en), I'm actually using Google sheets for this, which uses Re2. I've tried various approaches, but I haven't used regex much, so struggling with this. Any help welcome.
Thanks
Upvotes: 0
Views: 556
Reputation: 3971
The following pattern can be used to extract your text:
/content/web/gx/en/(\w+).*
See the full solution with capturing the group: https://regex101.com/r/C9S7P4/2
Upvotes: 0