Skip to main content
Charles Porch III (Salesforce) 님이 #REGEX에 질문했습니다

I want to allow these special characters: & ' * @ \ | ^ : , $ = ! / ` > - { ( [ < # % . + ? " } ) ] ; ~ _   and a blank space

 

Here is the validation I have but still getting Syntax error:

NOT(REGEX( Field Name ,"^[a-z A-Z&'*@\|^:,=!/`>{([<#%.+?"})]; ~_-]$")))

 

#REGEX #Validation Rule #Data Management

답변 3개
  1. 2021년 7월 14일 오후 5:31

    Hi @Charles Porch III   

     

    REGEX are sometimes very clunky but it does work very well if it comes to validation. For example, in your case, every character has its own functionality but if we want to pass through that special character we need to pass with \ backslash.  

     

    Try to use this:

     

    NOT(REGEX(Field Name ,"^[a-zA-Z&'*@|^:,;~_\\-=!\\/`>{}()\\[\\]<#%.+?\"]$"))

     

    Note:  You may use character class “[^\w]” but again in your case you want to consider only specific characters to pass through.

     

    Thanks.

0/9000