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 (\u{2} Doesn't Work

troyeb4
8 - Asteroid

I'm doing Weekly Challenge #54. The tool mastery for RegEx shows that \u{2} will extract 2 uppercase letters for state. I can't get it to work. In the string

 

11 North Warren Circle Lisbon Falls ME 04252

 

It gives me No not ME

 

Any ideas?

 

Thanks,

 

Troy

 

 

4 REPLIES 4

Hello @troyeb4 

 

Would you mind trying this syntax?

 

(\u{2})\s\d+$

 

Cheers!

c-lopez
Alteryx
Alteryx

This is because the RegEx \u{2} is expecting two character, that and nothing else

what you need instead is .*\u{2}.* to let the expression know to specifically look for two upper case chars in a sentence, and that you want to extract only that 

 

c-lopez_0-1595007134542.png

 

troyeb4
8 - Asteroid

Thanks for the reply @christine_assaad .

 

I did try that and it works perfectly if there is a Zip at the end but not all rows have a Zip at the end so it returns Null.

 

I was hoping to do it all in one go but looks like I'll do it in steps.

 

Thanks,

 

Troy

ChrisTX
15 - Aurora

It seems like the first example in the RegEx Tool Mastery article works if you use the entire RegEx, not just one section of the RegEx.

 

Here's the documentation from the the Boost-Extended Format String Syntax Guide

   https://www.boost.org/doc/libs/1_56_0/libs/regex/doc/html/boost_regex/format/boost_format_syntax.htm...

 

\u

Causes the next character to be outputted, to be output in upper case.

\U

Causes all subsequent characters to be output in upper case, until a \E is found.

 

But I don't think the explanation "\u{2} will extract 2 uppercase letters for state" is correct.

 

Chris

Labels