Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

Regex Match to return true for multiple string matches in column row

danclegg
7 - Meteor

I'm building a tool where I'd like to parse through the Alteryx Engine logs to identify entities (in my use case columns from a query, workflows, and Tableau TDEs) to do quick business analysis on requests made by customers.

 

To do this I've tried using both the Regex tool and Formula tool to search the lines of the log files to locate specific strings, such as "File successfully uploaded to" and "90_day_consolidated_V2.1.tde". 

 

Using the Regex tool I can get back positive matches using an 'or' in the Regular Express ^.*(File successfully uploaded to|90_day_consolidated_V2.1.tde).*$ but I'd like to be able to get a match with multiple whereby it's both strings returning a match and have replaced the or ( | ) with an and ( && ), which doesn't work.

 

Additionally, I've attempted to use formulas to accomplish this, ostensibly to be able, once I get this to work, to morph this into an analytical app where the user enters the data they want to match against.

 

To that end I've taken text input data from two columns [TargetItem] and [Action command] which, wherein the above scenario would have File successfully uploaded to as the [Action command] and 90_day_consolidated_V2.1.tde as the [TargetItem] values, I use the formula below to concatenate them into a single Regex to pass to another formula that hopefully would return a true.

 

To create the Final_Regex field:

IF ISNULL([Action command])
THEN "'.*\<"+[TargetItem]+"\>.*'"
ELSE "'.*\<"+[TargetItem]+"&&"+[Action command]+"\>.*'"
ENDIF

 

I then use this formula below to do the search. Nuttin'. 

 

REGEX_Match([Field_1], [Final_Regex])

 

How can I accomplish the multiple-strings-match-in-same-input-line search, preferably in a formula, but I'll take the Regex tool version too, if it's possible.

 

I remain,

Enquiring and Grateful of Response Rookie 😉

1 REPLY 1
vizAlter
12 - Quasar

@danclegg — Can you attach some sample data about your input and desired output, both?

Labels