In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests after December 31, 2025. Set up your security questions now so you can recover your account anytime, just log out and back in to get started. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
解決済み

RegEx (\u{2} Doesn't Work

troyeb4
アステロイド

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件の返信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
アステロイド

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
16 - Nebula
16 - Nebula

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

ラベル
トップのソリューション投稿者