Invalid if email address contains certain characters ie commers spaces etc

How do i use the expression invalid if email address contains certain characters ie ; , " " etc, for the comer I have tried “CONTAINS([EMAIL], “,”)” in the Invalid value error column but it does not work
TIA

0 5 327
5 REPLIES 5

@MyVideoi_Productions
Try with this:

NOT(CONTAINS(".,:;-_", USEREMAIL())

Unfortunately not, the column is Title “Clients Email” if that makes a difference
This statement is false:
…(".,:;-,_") contains the text value (USEREMAIL())

@MyVideoi_Productions

NOT(CONTAINS(".,:;-_", [Clients Email]))

I hate to seem argumentative and please correct me if I am wrong!

I believe the arguments in the CONTAINS() function need to be reversed like so,

...CONTAINS([Clients Email], "..."))

Also I don’t think the function treats ".,:;-_" as a list of items. Instead it will search for that as a substring in the email so will likely always return FALSE.

Unfortunately I don’t think CONTAINS() excepts a list at all. So you would need a separate CONTAINS() function for each special character you wanted to check against.

NOT(OR(
       CONTAINS([Clients Email], ","),
       CONTAINS([Clients Email], ":"),
       ...etc
      )
   ) 

FYI, I tried testing with IN() function. It is no better than the CONTAINS() function.

Steve
Platinum 4
Platinum 4

Try:

NOT(
  OR(
    CONTAINS([EMAIL], ","),
    CONTAINS([EMAIL], ";"),
    CONTAINS([EMAIL], " "),
    ...
  )
)

It’s bulky, but it’s the only way to do it.

Top Labels in this Space