You need to sign in to do that
Don't have an account?
Ron-LON
validation Rule REGEX with decimals
Hi,
I'm looking to validate software version numbers to ensure they contain only one decimal and can be between
0 and 99.99.
At first I thought I could just use a number, but with versioning, 1.3 and 1.30 are different values.
I thought this should work:
REGEX( Version_Number__c, "(\\d){0,2}(\\.)(\\d){0,2}" )
It works for whole numbers, but fails once you add in a decimal point.
Any tips would be appreciated.
Hi,
Try the below Regex
REGEX =/^[1-9]\d{0,1}(\.\d{2})?$/;
This works fine for 0 to 99.99.
Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.
If I put in
REGEX( Version_Number__c, "/^[1-9]\d{0,1}(\.\d{2})?$/;")
I get "syntax error" back.