I am working on a validation rule (potentially looking into other methods later) that will prevent users from putting a credit card number or social security number in a text field. The issue i am running into is the user may end up typing a sentence before either of these numbers since its typically a notes field.
I started with the SSN check and the
REGEX( Manager_Notes__c , "((\\d{3}-\\d{2}-\\d{4})|\\d{9})?")
works however if in this text field a user typesHi im a SSN 000-00-0000
then this validation rule does not fire. I'm looking for a way to validate if a SSN or a CC number is anywhere in a string of text so even if both are present the rule will fire.