How to Use Regex in Advanced Filter

Goal

Write the following simple filter regexp which matches email addresses as an advanced filter:

^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$

Learn

Since Datameer uses Java functionality, you need to escape the backslash (\) in REGEX.

Therefore the correct formula is:

REGEX(#Email; '^\\w+([-+.']\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$'; 'Good'; 'Malformed') 

If you are using the formula builder it creates the correct expression out of:

^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$ 

If you are going to use advanced filters you need to do it manually:

^\\w+([-+.']\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$ 

and it is necessary to use an formula which returns either true or false:

IF( REGEX(#Email; '^\\w+([-+.']\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$'; 'Good'; 'Malformed') == 'Good'; true; false)