community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
Community v19.6

Looks aren't everything... But the latest Community refresh looks darn good!

Learn More

Return text value when matching first occurance

Asteroid

I have a lengthy text file with below data:

 

To: X

From: S

Sent: Y

From: A

 

Ho w to embed below function into workflow?

 

[\n\r].*Sent:\s*([^\n\r]*)

Expected goal would be row without the "Sent:" string:

Y

 

Alteryx Certified Partner
Alteryx Certified Partner

Try this please:

 

regex_replace([Text],".*Sent:\s{1,2}(.*?)$",'$1')

It might work...

 

cheers,

 

Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and reboot. Order shall return.
Asteroid

Almost got it working.

 

However the function takes very last occurrence, not the first one.

 

image.png

 

image.png

Labels