Alteryx Designer Desktop Discussions

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

RegexMatch Digit and Alphabet

ssaz
6 - Meteoroid

Hello,

 

Appreciate if anyone could help on how to write regex to find the match for below:

 

31. TOPIC

 

I have tried (\d{2})(.)(\s+)([^a-z]+) which it works in regex101.com but not working in Alteryx.

 

Thanks

17 REPLIES 17
ssaz
6 - Meteoroid

I found the solution and updated the regex syntax to REGEX_Match([Data], "\d{0,3}.\s{0,1}[A-Za-z\-\_\s]+") these matches well , anyway thanks for the initial help!

ShankerV
17 - Castor

Hi @ssaz 

 

Please find the expected output is both ways.

 

ShankerV_0-1675930467306.png

 

ShankerV_1-1675930491919.png

 

Many thanks

Shanker V

 

 

 

binuacs
20 - Arcturus

@ssaz 

binuacs_0-1675930844943.png

 

ssaz
6 - Meteoroid

I realised one more thing my criteria for the words supposedly matching for all uppercase characters only, i updated the regex to this REGEX_Match([Data], "\d{1,3}\.\s+[A-Z\-\_\s]+") but not working to get pattern of numbers with uppercase alphabet.

binuacs
20 - Arcturus

@ssaz attaching the regex

 

REGEX_Match([Input], '^\d{1,}.*[A-Z]+[\s\-]?[A-Z]+$',0)

 

 

binuacs_0-1675979591862.png

 

ssaz
6 - Meteoroid

@binuacs

 

seems like the above regex capturing this pattern as well "3.2c Standard by ABCD"

ssaz
6 - Meteoroid

I have updated the regex to this REGEX_Match([Data], "\d{1,}\.\d{1}\s+[A-Z\-\_\s]+$",0) or
REGEX_Match([Data], "\d{1,}\.\s+[A-Z\-\_\s]+$",0), its working almost perfect now just not efficient enough since need to use both regex pattern

binuacs
20 - Arcturus

@ssaz please try

 

^\d{1,}\.\s.*[A-Z]+[\s\-]?[A-Z]+$

binuacs_0-1676014807304.png

 

Labels