Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

Remove a pesty acronym and digit pattern in and out of parentheses while preserving others

hellyars
13 - Pulsar

Remove a certain phrase.  

 

I want to remove any numerical patter that fits  \d{3}\-\d{2}.  I also want to remove OSIP.  Sometimes OSIP and the number pattern may fall within parentheses, but not always.  The data is very inconsistent.  I also want to preserve other acronyms contained in parentheses.  And, there are times when the numerical pattern appears outside of parentheses with or without the OSIP cue.

 

Help.

 

 

NAMEDesired Output 
Cervelo R3 (R3D) (04-14)Cervelo R3 (R3D) 
Cervelo S3 (OSIP 09-13)Cervelo S3 
Tesla Model 3 (OSIP 009-15)Tesla Model 3 
BMW-800GSA (009-13)BMW-800GSA 
Cervelo S1 OSIP 10-32Cervelo S1 
1 REPLY 1
ChrisTX
16 - Nebula
16 - Nebula

Brute force RegEx below.  I'm not a RegEx expert, so there may be an easier way to do this.

 

(.*)(\s\(\d{2,3}\-\d{2}\)|\s\(*OSIP\s\d{2,3}\-\d{2}\)*)

 

Annotation 2020-02-20 135723.png

 

 

Chris

Labels