Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Regex that strips random characters/symbols from amounts?

AkisM
10 - Fireball

I have a dataset that looks a bit like this:

 

S' 32,437.44
37,071.36
' 7,800.00
- 86.06
922.11 A[-A 40
*v S' 2,078.86
25,064.00
150,429.00

hdu/d 531,342.34 #$a8d

 

As you can see, there are random unwanted strings sometimes to the left, sometimes to the right, sometimes both, of the amount in the middle, which is also separated in thousands when applicable.

 

I tried (.+)?(\d{1,3},?(\d{3})?\.\d+)(.+)? but for some reason couldn't get the desired result. Any ideas?

4 REPLIES 4
Greg_Murray
12 - Quasar

try using 

[^\d|\.]

 

Greg_Murray_0-1584548983509.png

 

Greg

 

AkisM
10 - Fireball

Thanks Greg, it almost worked, but it has trouble in cases where there are digits in the unwanted left or right strings. Any modification that could deal with that too?

 

For example 

 

" 1 1 i / 2,253.48 xz

Greg_Murray
12 - Quasar

Sorry I didn't realize there were some random numbers outside of the amounts in a few of those. 

 

Try this one instead. 

 

Greg_Murray_0-1584549554608.png

 

AkisM
10 - Fireball

Thanks a lot @Greg_Murray , worked like a charm

Labels