Alteryx Designer Desktop Discussions

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

REGEX_Match issue in a formula

cjames728
7 - Meteor

After trying to search for an answer, I can see the frustration with this. I have a formula where I'm trying to search for a carriage return or a line feed anywhere within cells of a spreadsheet. The following is the formula

 

Contains([Value],"&") or
contains([Value],"&#") or
contains([Value],"/*") or
contains([value],"--") or
contains([Value],"<") or
contains([Value],">") or
contains([Value],"‘") or
contains([Value],"#") or
contains([Value],"“") or
contains([Value],"'") or
REGEX_Match([Value], "\n+") or
REGEX_Match([Value], "\r+")

 

The last 2 aren't working. Just for grins, I tested with

 

REGEX_MATCH([Value],"1+")

 

What this does is return true on fields that are equal to just "1" but will not return true for fields *containing* the number "1".

 

I must be missing something. W3Schools says placing a + after the character you're searching for should search for the character anywhere in the string.....

2 REPLIES 2
jrgo
14 - Magnetar

@cjames728

 

This this...

Contains([Value],"&") or
contains([Value],"&#") or
contains([Value],"/*") or
contains([value],"--") or
contains([Value],"<") or
contains([Value],">") or
contains([Value],"‘") or
contains([Value],"#") or
contains([Value],"“") or
contains([Value],"'") or
REGEX_Match([Value], ".*[\n\r].*")

When you're matching, it needs to qualify the entire string. Your original expression was saying to match if the [Value] contains ONLY a new line/return character 1 or more times and nothing else.

 

Hope this helps!

 

Jimmy

cjames728
7 - Meteor

Thanks. REGEX is gonna be a loooong road for me....

Labels