You need to sign in to do that
Don't have an account?
Integration User 617
Regex validation rule for birthday
Hi all,
I am attempting to create a validation rule for a birthday field (US) where the user has the ability to enter either MM/DD or MM/DD/YYYY. While I have the validation currently working, my issue is that the REGEX currently allows for months greater than 12 which is causing issues for data governance. Is it possible to have either a LEFT(Birthday__c, 2) < 12 or modify the Regex so that it does not allow for months greater than 12? Below is a sample of my rule:
I am attempting to create a validation rule for a birthday field (US) where the user has the ability to enter either MM/DD or MM/DD/YYYY. While I have the validation currently working, my issue is that the REGEX currently allows for months greater than 12 which is causing issues for data governance. Is it possible to have either a LEFT(Birthday__c, 2) < 12 or modify the Regex so that it does not allow for months greater than 12? Below is a sample of my rule:
NOT( OR( ISBLANK(Birthday__c), REGEX(Birthday__c , "[0-1]{1}[0-9]{1}/[0-3]{1}[0-9]{1}"), REGEX(Birthday__c , "[0-1]{1}[0-9]{1}/[0-3]{1}[0-9]{1}/[1-2]{1}[0-9]{1}[0-9]{1}[0-9]{1}") ) )
Please try below Regex and let me know if it works
I hope you find the above solution helpful. If it does mark as best answer to help others too.
Thanks,
Ramesh D