Page 1 of 1

matches_regex should contain alphabets, numbers and Tilda

Posted: Tue Oct 18, 2016 12:54 pm
by adityavarma
Hi All,

I am trying to create a IA rule for value check for one of the column

Rule:
Field should have all three alphabets ,numbers and Special Character ~ ( tilda) otherwise the rule should fail

Example :
ABCD~2016187~1
ABC~2016187

the above data should be passed and below should be failed
FNAL~
123~

I have tried the below, but still the rule is not working, can you please advise on how to proceed on this

trim(column) matches_regex '^[-a-zA-Z~0-9~0-9]$'

Posted: Tue Oct 18, 2016 8:53 pm
by ray.wurlod
Looks to me like you need to learn more about constructing regular expressions. For example \d* for zero or more digits, or \d{1,} for one or more digits. There are plenty of tutorials and other resources on the web.

The Posix class [:alpha:] might also be useful; I can't currently check whether these are supported in IA matches_regex checks.