Let’s talk Alteryx Copilot. Join the live AMA event to connect with the Alteryx team, ask questions, and hear how others are exploring what Copilot can do. Have Copilot questions? Ask here!
Start Free Trial

Alteryx Designer Desktop Discussions

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

Extracting info between a set of brackets, where the string contains multiple brackets.

Deano_280
7 - Meteor

Hi all,

 

Seeking guidance once again on how best to go about extracting a piece of information. 

 

Below are a couple of examples of the sorts of strings that will be formatted. I'm unable to share the real sample but it will contain several thousand rows. Each important piece of information is between brackets with the word "and" being the separator between these pieces.

 

My aim is to extract the Days Until Review Date information, ideally saying "is less than 10950" or "=7300 or lower" depending on the format. I am happy for it to contain the full text as "Days Until Review Date is less than 10950" for example. 

 

Important to note, the Days Until Review Date can appear in a different position in different strings, e.g. not the final bracketed piece of information as in example 1.

 

1. (Housing Type in (Flat)) and (Country Of Property in (GERMANY)) and (Purchase Currency in (Euro)) and (Safety Rating (Low, Multi, F/I, Latest) = 149 or higher) and (Days Until Review Date is less than 10950)


2. (Housing Type in (House)) and (Country Of Property in (UK)) and (Purchase Currency in (Sterling)) and (Days Until Review Date = 7300 or lower) and (Safety Rating (Low, Multi, F/I, Latest) = 149 or higher)

 

I am open to any weird and wonderful methods. I have used RegEx for similar situations however I'm not well versed enough to think of the expressions that would be used. Thank you!

2 REPLIES 2
Aaron_Foster
6 - Meteoroid

I think this regex should do what you need:               .*\( *(Days Until Review Date[^)]*) *\).*

Aaron Foster, CPA | Crowe LLP Managing Director
Deano_280
7 - Meteor

That has worked perfectly thanks Aaron!

Labels
Top Solution Authors