Important Community update: The process for changing your account details was updated on June 25th. Learn how this impacts your Community experience and the actions we suggest you take to secure your account here.

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
6 - Meteoroid

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
15 - Aurora

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

Labels