Alteryx Designer Desktop Discussions

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

regex_match formula VS regex tool issue

anthony
11 - Bolide

Hi, I am trying to find all urls in a list that have a subdomain domain by using \..*\.  which finds all urls with a dot domain dot. (btw this does not really work for domain.co.uk but I don't need that right now.)

 

This works great in the regex tool but if try to use in the regex_match formula it does not find those domains.

 

It seems the engine works differently between tool and formula?

 

What regex would i use the formula to get the same results as the regex tool?

 

Thanks,

Anthony

 

 

10 REPLIES 10
MarqueeCrew
20 - Arcturus
20 - Arcturus

REGEX_MATCH([field1],".+[.].+" )

 

that should find anything followed by a '.' followed by more stuff

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
anthony
11 - Bolide

Why does the syntax need to be differnet?

 

 

Btw this worked REGEX_MATCH([Location on Site],".+[.].+[.].+" )

to find all store.domain.com's vs store.com

MarqueeCrew
20 - Arcturus
20 - Arcturus

Anthony,

 

I'm a little bit confused.  I tested a regex tool (match) and a formula and got identical results.  See pic/module.  can you show me where it goes wrong for you?  Also, I only match store.domain.com with your expression.

 

Capture.PNG

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
anthony
11 - Bolide

I am trying to use the regex \..*\. in the formula. but what works in tool does not work in formula. See image and updated workflow.Capture.PNG

MarqueeCrew
20 - Arcturus
20 - Arcturus

Parse, replace, match ...

 

With the functions of regex_replace I get the same results as REGEX tool with choice of replace, same with match.

 

Parse is a different animal. :)

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
MichelSza
7 - Meteor

Hi Anthony,

 

You can still  mimic the result of the Parse tool (using the Output Metthd="Parse" ) in a formula by using regex_replace rather than regex_match:

testRegEx_Amit.jpg

 

yes, Parse and Match are somewhat different and there is no Regex_parse function as this is the role of the parse tool.

 

Cheers,

Michel

 

anthony
11 - Bolide

Ok, technically I was not trying to parse as I just wanted to filter all subdomain urls from the non www. subdomains so I could go to the next step.

 

I use the regex tool quite a bit and was surprised to find out the same regex does not work in formula match. Does not help I started learning regex 20 years ago in VIM which again uses a different syntax.

 

Anyway, thanks for the help - as always I can usually find a hack around what I am trying to accomplish no matter how hard alterxy tries to stop me.

dshaw
8 - Asteroid

I need help with a REGEX formula.  I want to take  a column called Quarter in the following string format 2008Q1 and I want to change to the following format date format (Month, yyyy), so 03, 2008 for 2008Q1 so that I can use the DateTime format to convert to DateTime.  So, 2008Q2, would be 06, 2008, 2008Q3 would be 09, 2008, and  2008Q4 would be 12,2008.

 

Thanks,

 

Derreck

MichelSza
7 - Meteor

Hi Derreck,

 

You can split on the 'Q' and multiply the second part by 3.

After you'll need to recreate the date as a string and parse it.

 

Have a look at the attached WF.

hope it helps

 

Michel 

 

Labels