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

Alteryx Designer Desktop Discussions

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

Regex Tool usage

faisal9999
8 - Asteroid

daHi All please help me to find out the desired output only through REGEX tool. There are 5 questions that I am struggling with.

 

1Required : Only last two letter of string.  4Required : where AF in the last pick "AF" and if Diff is at start then pick "Diff"
  InputOutput   InputOutput  
  CityCity   CategoryCategory  
  Delhihi   London_File_AFAF  
  Mumbaiai   Diff_London_FileDiff  
       UK_File_AFAF  
2Required : Only required first and last word of string    Diff_UK_FileDiff  
  InputOutput       
  CategoryCategory 5Required : Delimeter split (_)   
  Zebra Crossing RepublicZebra Republic   InputOutput
  John Smith CrossingJohn Crossing   CategoryR1R2R3
       London_File_AFLondonFileAF
3Required : Only required last word of string    Diff_London_FileDiffLondonFile
  InputOutput       
  CategoryCategory       
  Zebra Crossing RepublicRepublic       
  John Smith CrossingCrossing       
           
           
1 REPLY 1
griffinwelsh
12 - Quasar

@faisal9999 Workflow solution is attached. Please mark solved if this works for you.

 

  1. Parse ([a-z]{2}\>)
  2. Replace with space [ ][a-z]+[ ]
  3. Parse ([^ ]+$)
  4. Parse (\<Diff|AF\>)
  5. Tokenize [^_]+
Labels
Top Solution Authors