Start Free Trial

Alteryx Designer Desktop Discussions

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

Stripping out a DD-MM-YYYY date from text into a seperate field

thompo511
7 - Meteor

Hey,

 

I have the following body of text. I need to strip the date out (DD-MM-YYYY) from this cell into a new field. I haven't been able to master RegEX to make this work. I've added the full dataset for reference also. 

 

Arev: false
Bravo: true
Select action:: Remove
Please select the User leaving the company: {Name redacted}
Bravo: Yes
Please select the last day of the User in the Company: 26-08-2022
Arev: Yes

 

Thanks

 

 

4 REPLIES 4
JosephSerpis
17 - Castor
17 - Castor

Hi @thompo511 using (\d{2}-\d{2}-|d{4}) in the regex tool for the option Output Method Parse should do the trick. This regex will find two digts seperated by a dash followed by another two digts seperated by a dash followed by four digits.

 

Regex_27012023.JPG

ShankerV
17 - Castor

@thompo511 

 

Please find the expected output

 

ShankerV_0-1674815981740.png

 

Many thanks

Shanker V

ShankerV
17 - Castor

Hi @thompo511 

 

I have used the below expression to extract the output.

 

(\d{2}[-|/]\d{2}[-|/]\d{4})

 

As there are 2 different date formats in the input file shared, I assume we need to extract both the dates.

[-|/]

The above works like or, where it will help to read the - or /

\d{2} helps to read 2 digits exactly and \d{4} helps to read 4 digits exactly which will be 0-9

 

 

ShankerV_1-1674816099641.png

 

 

 

thompo511
7 - Meteor

Thanks all, these solutions have been really helpful!!

Labels
Top Solution Authors