We started using Google Data Studio to visualize our data, and we need RegEx to help us extract a specific piece of text from the URL list from our system.
URL example:
/town/articletype/46646-this-is-an-example-article
What we need from the URL by using RegEx:
/town/(without slashes, and eventually capitalized the first letter, if possible)/articletype/(also without slashes)/46646-(without / and - && this is the article ID we also need)-this-is-an-example-article(without "-" and capitalized first letter)
We tried numerous RegEx, and we managed to extract /town/ from the URL by using the following Calculated Field:
REGEXP_EXTRACT(Page , '/(.*?)(/)')

^\/([a-z]+)\/([a-z]+)\/([0-9]+)-(\S+)$. Now, about removing the-and capitalizing, I suggest you do that using something else other than regular expressions.