Start Free Trial

Alteryx Designer Desktop Discussions

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

RegEx Parse after addition sign (+)

CSchimm
5 - Atom

I am attempting to parse an item of text that contains pricing information +/- an adder. The data would look something like this:

 

Pricing information using service 1 + 0.0075 USD/gal

Pricing information using a different service - 0.015 USD/gal

 

The information at the beginning can/will be different, but it always ends with plus or minus some number. I have successfully parsed the ones that are subtracting a number using RegEx Parse with Regular Expression:  -(.*)     However, when I try to do the same exact thing with the plus sign, +(.*)  I get the following error. "RegEx: An attempt to repeat something that can not be repeated - for example a*+ at character 0"

 

I have spent quite a while searching the community to find somebody else who had issues parsing at a + sign but came up short. Can anybody help?

 

Thanks!

Cailin

4 REPLIES 4
binu_acs
21 - Polaris

@CSchimm Something like this

 

binuacs_0-1675364256617.png

 

CSchimm
5 - Atom

Thank you so much! For those who might find this helpful later, I wanted to keep the positive and negative signs on the adder at the end, so I created two expressions in the same formula tool and created two separate columns one as "positive" and the other "negative." I am certain there were more efficient ways to do this, but as a beginner, this makes sense to me. 

 

In addition, putting the whole expression in TONUMBER(), I was able to get the end information as a double in order to add/subtract later.

 

Thanks again!!

BS_THE_ANALYST
15 - Aurora
15 - Aurora

@binu_acs In RegEx, when you are using special characters inside character classes [] I don't think you need to escape '\' the special characters. I could be wrong though! 😂. See below

BS_THE_ANALYST_1-1675373843046.png

 

 

All the best,
BS

LinkedIN

Bulien
binu_acs
21 - Polaris

@BS_THE_ANALYST interesting !!! 

Labels
Top Solution Authors