Validation rule for Numbers and Special Characters in Salesforce

If your field Should contain number and (',',';', and '/') special characters alone, use the below validation rule

Validation Rule:

NOT(
        REGEX( SLASerialNumber__c , "[0-9,;/]*")
        )


Cheers!!!

2 comments:

  1. Hi I need hypen to be added:but the below code doent accept the hypen-.Not working.
    NOT(
    REGEX( SLASerialNumber__c , "[0-9,;/-]*")
    )

    ReplyDelete
    Replies
    1. try this

      NOT(
      REGEX(InfallibleTech__Area__c , "[0-9,;,/,-]*")
      )

      Cheers!

      Delete