Alteryx Designer Desktop Discussions

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

Identifying a NEW LINE character in regex expression

JHAROHIT
7 - Meteor

Hi,

 

I have a requirement of passing certain characters in the expression. It should pass Numbers, Alphabets, certain special characters and Latin characters.

The code is as below: 

If

REGEX_MATCH([FIELD],'[A-Za-z0-9\.\·\`\ \\n\,\-\\ÀÈÌÒÙàèìòùÁÉÍÓÚÝáéíóúýÂÊÎÔÛâêîôûÃÑÕãñõÄËÏÖÜŸäëïöüŸ¡¿çÇŒœßØøÅåÆæÞþÐð]+') = 0
then 
'F'
else
'T'
endif

 

I have entered '\n' as in the list of allowable characters but the code is still catching New line characters as exceptions.

Any thoughts or inputs are appreciated.

 

Thank you.

3 REPLIES 3
PhilipMannering
16 - Nebula
16 - Nebula

Looks like you have to backslashes before the n `\\n` ... this would just include a "\" or an "n".

 

Something like this might work,

 

 

 

 

If REGEX_MATCH([FIELD],'[-A-Za-z0-9.·`\n,ÀÈÌÒÙàèìòùÁÉÍÓÚÝáéíóúýÂÊÎÔÛâêîôûÃÑÕãñõÄËÏÖÜŸäëïöüŸ¡¿çÇŒœßØøÅåÆæÞþÐð]+')
then 
'T'
else
'F'
endif

 

 

 

I think the only backslash you need in there is the one for "\n".

PhilipMannering
16 - Nebula
16 - Nebula

This also might be simpler and do the same job,

If REGEX_MATCH([FIELD],'[\w\n\s.·`,-]+')
then 'T' else 'F' endif
Raj
16 - Nebula

@JHAROHIT 
try this
If REGEX_MATCH([FIELD], '[\w.\·\s,\\\-À-ÿ¡¿çÇŒœßØøÅåÆæÞþÐð]+') = 0 then 'F' else 'T' endif

Polls
We’re dying to get your help in determining what the new profile picture frame should be this Halloween. Cast your vote and help us haunt the Community with the best spooky character.
Don’t ghost us—pick your favorite now!
Labels