Free Trial

Alteryx Designer Desktop Discussions

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

Regex Match

hari24
5 - Atom

Hi everyone, 

 

I am having trouble with a regex formula in Alteryx that's supposed to flag rows based on whether they start with a lowercase letter. Here's what I am aiming for : 

 

The objective is I want to flag rows where the text starts with a lowercase letter as "Combine" and all the other rows as "Keep". 

 

I used the formula below - 

IF REGEX_Match([F1], "^[a-z]") THEN
"Combine"
ELSE
"Keep"
ENDIF

The formula seems to be returning "Keep" for all rows, including those that should be flagged as "Combine".

 

The field "F1" is clean. Any advice on why this might not be working as expected ?

 

Thank you in advance for your assistance.

 

 

 

3 REPLIES 3
ShankerV
17 - Castor

Hi @hari24 

 

Please try the below formula, it worked.

 

IF REGEX_Match(Left([Field1],1),LowerCase(Left([Field1],1)),0) THEN
"Combine"
ELSE
"Keep"
ENDIF

 

Screenshot 2024-08-16 131708sss.png

Many thanks

Shanker V

OTrieger
12 - Quasar

Hello @hari24 

It means that the first argument of your formula does not get matches as you only get results for the later part.

What you can do to simplify it, create a new field which will be Left([F1],1), that will leave you with only 1 character, you can can set a check if that one character is Upper Caps or not. Then you can get rid of that added field.

hari24
5 - Atom

It worked, Thank you 

Labels
Top Solution Authors