In case you missed the announcement: Alteryx One is here, and so is the Spring Release! Learn more about these new and exciting releases 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
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

Labels
Top Solution Authors