Identifying a NEW LINE character in regex expression
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Labels:
- Regex
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
This also might be simpler and do the same job,
If REGEX_MATCH([FIELD],'[\w\n\s.·`,-]+')
then 'T' else 'F' endif
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@JHAROHIT
try this
If REGEX_MATCH([FIELD], '[\w.\·\s,\\\-À-ÿ¡¿çÇŒœßØøÅ寿ÞþÐð]+') = 0 then 'F' else 'T' endif
