You need to sign in to do that
Don't have an account?
Joe Hayes
REGEX Problem
Hi Everyone,
I have a text field that I want to start with a date in the dd/mm/yy format.
I am trying to get a REGEX validation rule to force this but I am struggling.
I need the rule to allow dd/mm/yy - *
The* will allow any text afterward.
Would someone be able to tell me the correct expression please?
Thanks
Joe
I have a text field that I want to start with a date in the dd/mm/yy format.
I am trying to get a REGEX validation rule to force this but I am struggling.
I need the rule to allow dd/mm/yy - *
The* will allow any text afterward.
Would someone be able to tell me the correct expression please?
Thanks
Joe
In that case, you can use the below formula
Also, you can check the below link to learn regex. They have got awesome stuff for beginners.
https://regexone.com/
Hope that helps !
All Answers
You can use the below formula to validate that your text begins with dd/mm/yy format.
Replace the "Name" field with the text field that you want to validate.
Hope that helps !
Thanks for your help, that does work however it will also allow dd/mm/yyyy.
I need it to specifically only allow the first 11 characters to be "dd/mm/yy - "
The space hyphen space on the end is also important. After that anything can be allowed.
Not sure why but I just can't get my head round the structure of regex no matter how much I read about it.
Thank you
Joe
In that case, you can use the below formula
Also, you can check the below link to learn regex. They have got awesome stuff for beginners.
https://regexone.com/
Hope that helps !
I'll have a read of that link :)
Thank you for your help
Kindly mark an answer so that we can close this thread.
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