You need to sign in to do that
Don't have an account?
Rakesh Kumar 378
Hi All,
I have a requirement where I need to check the format of a text field like DD/MM but we need to ensure that if we enter 02 as month then it should not allow to use any value above than 28. I am using the below mentioned validation rule and it checks every thing excep the feb month condition
AND(
NOT(ISBLANK(EarliestStartDate__c)),
NOT(REGEX( EarliestStartDate__c ,"(0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])"))
)
Kindly suggest
Regex Trouble
Hi All,
I have a requirement where I need to check the format of a text field like DD/MM but we need to ensure that if we enter 02 as month then it should not allow to use any value above than 28. I am using the below mentioned validation rule and it checks every thing excep the feb month condition
AND(
NOT(ISBLANK(EarliestStartDate__c)),
NOT(REGEX( EarliestStartDate__c ,"(0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])"))
)
Kindly suggest
28/02 is not correct as a limit. A leap year also needs 29/02 and the year but be included in the format.
Description: This expression is an improved version of Maag. It checks a date field in the Australian DD/MM/YYYY format.
Besides, it also validates leap year between 1900 and 2099.
Matches: 29/02/1992 | 29/02/2000 | 29/02/2004
Non-Matches: 29/02/1892 | 29/02/2100 | 29/02/3004
Author: Yik Kheam Tan
Rule Name: check_DD_M
Error Condition Formula:
REGEX( test_text__c ,"^(((((0[1-9])|(1\\d)|(2[0-8]))/((0[1-9])|(1[0-2])))|((31/((0[13578])|(1[02])))|((29|30)/((0[1,3-9])|(1[0-2])))))/((20[0-9][0-9]))|((((0[1-9])|(1\\d)|(2[0-8]))/((0[1-9])|(1[0-2])))|((31/((0[13578])|(1[02])))|((29|30)/((0[1,3-9])|(1[0-2])))))/((19[0-9][0-9]))|(29/02/20(([02468][048])|([13579][26])))|(29/02/19(([02468][048])|([13579][26]))))$")
http://regexlib.com/REDetails.aspx?regexp_id=708