Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

regex

xariet
8 - Asteroid

Hi All

I am trying to extract all instances of the links part /the-team/letters/

href="/the-team/A-B/"

href="/the-team/A-V-K-P/"

href="/the-team/B-P/"

href="/the-team/B-P-O/"

the regex I am trying    /the-team/\w+(?:-\w+)/      does capture only if I have two letters divided by a hyphen (/the-team/A-B/  and /the-team/B-P/) 

which expression will bring me all links?

 

thank you  

2 REPLIES 2
DataNath
17 - Castor

Hey @xariet, the following will capture everything up until the next / which will allow you to capture all letters. Unless there's any other scenarios where you don't want to capture this part?

the-team\/([^/]+)

DataNath_0-1679651216694.png

Christina_H
14 - Magnetar

Your RegEx is really close, all you would need to do is move the + outside your non-capturing group

/the-team/\w+(?:-\w)+/

Labels