Alteryx Designer Desktop Discussions

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

RegEx or Formula tool to identify strings with two dots in a column

AKPWZ
8 - Asteroid

Hi everyone, 

I have question regarding a formula or say RegEx
Can you please help me to find a regex to find two dots in these two strings:

- properties.hs_legal_basis.value

- properties.hs_legal_basis.versions.0.value
Say above two values are in a column and I want to keep only a string which has only two dots in it and rest it exclude from the column and the final output would be one string left as mentioned below.
properties.hs_legal_basis.value

 

I tried some of the RegEx in RegEx tool and Formula in Formula tool but nothing works for me.

Please help me on this. 

Thank you

3 REPLIES 3
Christina_H
14 - Magnetar

Try this in a filter tool:

REGEX_Match([Field1],"[^\.]*\.[^\.]*\.[^\.]*")

image.png

Hammad_Rashid
11 - Bolide

One possible regex that can do this is:

^[^.]*\.[^.]*\.[^.]*$

This regex means:

  • ^ matches the start of the string
  • [^.]* matches zero or more characters that are not dots
  • \. matches a literal dot
  • [^.]* matches zero or more characters that are not dots
  • \. matches a literal dot
  • [^.]* matches zero or more characters that are not dots
  • $ matches the end of the string

 

 
 
 

 

binuacs
20 - Arcturus

@AKPWZ @Add the below condition in the filter tool

 

REGEX_CountMatches([Field],\.) <= 2

Labels