Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Retrieve String up until second pattern RegEx

ericamoody
6 - Meteoroid

Hello, 

 

I have a field called 'Work Notes' that looks like below. I'm trying to use the RegEx tool to retrieve only the 'Latest Work Note'. I'm able to identify the dates using the pattern below, but I'm struggling to retrieve all string up until the second occurrence of the pattern. Can someone please advise?

 

(\d{2}-[[:alpha:]]{3}-\d{4} \d{2}:\d{2}:\d{2} - )

 

Work NoteLatest Work Note
10-Jan-2020 12:00:00 - John Doe (Add a Work Note) Met with lazy dog, the quick brown fox has in fact jumped over the him. Closing this inquiry. 09-Jan-2020 04:55:00 - Jane Deer (Add a Work Note) Still trying to speak with dog to confirm whether fox has in fact jumped. 06-Jan-2020 15:38:00 - Jerry Delgado (Add a Work Note) Opened this inquiry to see if the quick brown fox has jumped over the lazy dog?10-Jan-2020 12:00:00 - John Doe (Add a Work Note) Met with lazy dog, the quick brown fox has in fact jumped over the him. Closing this inquiry.
08-Jan-2020 17:00:00 - Rupert Smith (Add a Work Note) Closing this request - it is a duplicate of request ABC123.08-Jan-2020 17:00:00 - Rupert Smith (Add a Work Note) Closing this request - it is a duplicate of request ABC123.
[Null][Null]

 

Thank you!!

4 REPLIES 4
NickSm
Alteryx
Alteryx

Hi @ericamoody 

 

You could certainly work some more on a RegEx expression that just takes the string up until the second date, but came up with a quick variation that can provide some additional detail even. I used another RegEx to replace dates as a separator (the "|" character) so that you can view all work notes for each, and then limit to the latest if desired.

 

Feel free to check out the attached workflow

fmvizcaino
17 - Castor
17 - Castor

Hi @ericamoody ,

 

Here is a suggestion.

fmvizcaino_0-1592852329478.png

 

 

Best,

Fernando Vizcaino

ericamoody
6 - Meteoroid

Thank you so much @NickSm ! This is very helpful.

ericamoody
6 - Meteoroid

Thank you @fmvizcaino!! This is exactly what I was looking for! 😄

Labels