You need to sign in to do that
Don't have an account?
llisa
Validation Rule using Regular Expression
Hello Everyone,
i am trying to make a validation rule for a text field with 2 decimal values just like 20/30,40/50,1/2,12/4 and single numbers.
It should give error message if it is like 122/22 or 299/349.
Here i wrote a validation rule :
NOT(REGEX(Edited_Discount__c,"[0-9]+[/]{1}[0-9]{2}"))
It will Validate 20/30,40/50 but when i give single it throws validation exception.
Please help me on this .
Thanks
Lisa
i am trying to make a validation rule for a text field with 2 decimal values just like 20/30,40/50,1/2,12/4 and single numbers.
It should give error message if it is like 122/22 or 299/349.
Here i wrote a validation rule :
NOT(REGEX(Edited_Discount__c,"[0-9]+[/]{1}[0-9]{2}"))
It will Validate 20/30,40/50 but when i give single it throws validation exception.
Please help me on this .
Thanks
Lisa
NOT(REGEX(Edited_Discount__c,"[0-9]+[/]{1}[0-9]{1,2}"))
OR
NOT(REGEX(Edited_Discount__c,"[0-9]{1,2}[/]{1}[0-9]{1,2}"))
Try this one. It worked for me
Not(REGEX( AccountNumber, "[0-9]{1,2}[/]{1}[0-9]{1,2}"))
Try this once
I wrote a validation rule :
AND (LEN(Edited_Discount__c) <> 2 , LEN(Edited_Discount__c) <> 1 ,NOT(REGEX(Edited_Discount__c,"[0-9]{1,2}[/]{1}[0-9]{1,2}")))
It works. If you know anything else then this . plz share your ideas with me.
Thanks
Lisa
AND(Not(REGEX( AccountNumber, "[0-9]{1,2}[/]{1}[0-9]{1,2}")), NOT(REGEX( AccountNumber, "[0-9]{1,2}")))