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

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
Announcement | We'll be doing maintenance between 9am-11am MT on Saturday, January 25th, which may impact your experience. Thanks for your patience as we work on improving the community!

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