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

Regex for everything between ALL CAPS phrase

reynae3
7 - Meteor

Hey there!

 

New to RegEx and can't seem to produce the correct combination of expressions to create two new columns from an existing string field.

 

The field is data from manually entered description with two components. 

 

The first is CRITICAL UPDATE and the second is RELEASE BLURB

 

Looks similar to this

 

 

CRITICAL UPDATE 05/31/2017 This is a sentence I need to extract to a separate field. This sentence should appear together with the first.

RELEASE BLURB: This sentence needs to appear in a new field. This sentence should go along with the first. This one too. This one as well. 

 

( I should add that on ALteryx the cell shows up with a line space between the two)

Since it is a manually entered field, the colon is not always a reliable delimiter. I think the only thing I can count on is that the heading phrases will be in all caps. 

 

I appreciate any help with this!

6 REPLIES 6
jdunkerley79
ACE Emeritus
ACE Emeritus

Assuming you want the date attached:

([A-Z0-9 :/]+) (.*)

 

should do roughly what you need. You must untick case insensitive in the Regex Tool.

 

Sample attached 

reynae3
7 - Meteor

This only separates the critical update from it's corresponding text and the corresponding text cells show red corner arrows alerting that "This cell has embedded newlines."

alex
11 - Bolide

Try this out.  It works for your example.

 

alex
11 - Bolide

@jdunkerley79 text input had a couple extra spaces in the end of the second line.  I removed them and it worked fine.  His solution is better than the one I posted.

jdunkerley79
ACE Emeritus
ACE Emeritus

If all the text is in a single cell then a little more complex:

 

 

CRITICAL UPDATE:?\W+[0-9\/]*:?\W(.*)[\r\n]{1,2}RELEASE BLURB:?\W?(.*)

will do what you need assuming explicitly CRITICAL UPDATE to RELEASE BLURB

 

 

If you want  between generic ALL caps then fiddlier

reynae3
7 - Meteor

This hit the sweet spot with no irregularities. THANKS A BUNCH!

Labels