Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

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

RegEx Help

markcurry
12 - Quasar

Hi, I'm trying to extract the day, month and year from some string values.  The month will be Jan, Feb, Mar... etc, but the RegEx statement I have is only returning the last letter of the month.  Any ideas would be greatly appreciated.

 

Sample Data

Payment was made on the 15 - Feb, 2021
Payment is due on 1st - Feb, 2021
Payment was made on the 13 - Dec, 2021
Payment was made on the 14th - Dec, 2021
Due on the 15 Dec 2021
Ignore this one due on the 15 Xyz 2021

 

The RegEx statement I have is... 

 

 

.*(?<!\d)(\d{1,2})[st|nd|rd|th]?.*([Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec]),?\s(\d{4}).*

 

 

 

Thanks

3 REPLIES 3
binuacs
21 - Polaris

@markcurry 

 

binuacs_0-1641415236284.png

 

mmenth
11 - Bolide

Hi @markcurry 

 

You just don't need the brackets:
.*(?<!\d)(\d{1,2})[st|nd|rd|th]?.*(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec),?\s(\d{4}).*

 

Best,

mmenth

markcurry
12 - Quasar

@mmenth thanks a million, that did the trick.

Labels
Top Solution Authors