Reputation: 936
I have a column which has urls, So below are the values of the column
https://www.example.com/jasja
https://www.example.com/jasdqw?new=exact
So what I want to extract is before the question mark and after the last slash
So here my output in the column should be
jasja
jasdqw
How can I get this using Regex
Tried =REGEXEXTRACT(C2:C16, SPLIT())
, but don't know how to use this
Any help is appreciated
Upvotes: 1
Views: 40
Reputation: 522741
We can use REGEXEXTRACT
with a capture group:
=REGEXEXTRACT(C2, "/([^/]+?)(?:\?|$)")
Here is a regex demo.
Upvotes: 1