Alteryx Designer Desktop Discussions

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

Please help with Regex Match

smile_dt06
6 - Meteoroid

Dear all,

 

I try to get the regexmatch formulae so that if the pattern is match with case 1 or 2 below then proceed with next step, if it falls to case 3 then return to error.

 

Case 1: My best company_0123456798_Something 2 documents_Calculation 1

Expected result: True

Case 2: Company 9A_0123456798_dhjgsfhjg_hgjhg

Expected result: True

Case 3: 0127637655_Bcd-gjgajg

Expected result: False

 

I have write the below formulae but it does not working. Please help me. Thank you.

^[A-Z|0-9|\s*]\_\d{10}\_*

 

5 REPLIES 5
mceleavey
17 - Castor
17 - Castor

@smile_dt06 ,

 

Can you tell us what you're matching to achieve true and false? What's the logic?

 

M.



Bulien

mceleavey
17 - Castor
17 - Castor

@smile_dt06 ,

 

Without knowing all the rules I've built the following which returns the correct result:

 

^.*?[_]\d{10}.+

 

mceleavey_0-1623925119543.png

 

 

Hope this helps,

 

M.



Bulien

OllieClarke
15 - Aurora
15 - Aurora

Hey @smile_dt06 

does this work?

 

REGEX_MATCH([Field],'[A-Za-z0-9 ]*_\d{10}_.*')

 

Which should only be true for strings that start with a combination of letters, numbers and spaces, followed by a 10 digit number flanked by underscores

 

Hope that helps

 

Ollie

smile_dt06
6 - Meteoroid

@mceleavey and @OllieClarke 

 

Thank you for your help these formulas work perfectly. 

mceleavey
17 - Castor
17 - Castor

no problem.gif



Bulien

Labels