community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

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

Extraction of String between two []

Highlighted
Meteoroid

Hi there

 

I am struggling to extract the string between the [] below and move it into a new column, dropping the rest of the string;

 

i.e. the field contains the following string: 'Germany[DE]' and I would only like to keep 'DE'. I have tried using REGEX Replace and the RegEx Tool but I have been unsuccessful.

 

Thanks for you help in advance.

Try the following a REGEX tool in parse mode with

\[(.*?)\]

The Square brackets must be escaped.

Alteryx Certified Partner
Alteryx Certified Partner

Hi @rebeccarlisle

 

Use the Parse Method and this RegEx

(.*)(?:\[)(.*)(?:\])

 

Cheers,

Labels