Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

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

Help with regex - Stop reading with specific word

jackersantos
8 - Asteroid

I wrote this regex expression to capture anything after "Comments" and now I want to stop reading once alteryx finds "https" for instance. I saw some topics about regex but I couldn't find a way to ask alteryx to stop reading as soon as it finds "https". Any ideas on how to achieve this?

Thanks.

jackersantos_1-1636051532062.png

 

 

5 REPLIES 5
jackersantos
8 - Asteroid

Please ignore the "/webapp". It was just some testing I was doing

fmvizcaino
17 - Castor
17 - Castor

Hey @jackersantos ,

 

You can put everything you want between parenthesis.

(\W+Comments\D.+)?HTTP

 

Best,

Fernando Vizcaino

Jonathan-Sherman
15 - Aurora
15 - Aurora

Hi @jackersantos,

 

You could use the following in parse mode in a Regex tool:

Comments(.*?)https

 

JonathanSherman_0-1636052269173.png

 

The brackets indicate a capture group and tell Alteryx to extract the part inside, the .*? is a non greedy wildcard expression which effectively means extract everything you can find up to the next iteration of https.

 

Kind regards,

Jonathan

 

jackersantos
8 - Asteroid

Thank you very much!

Jonathan-Sherman
15 - Aurora
15 - Aurora

No problem!

Labels
Top Solution Authors