I have a text field in the Sitecore form where the user needs to enter a Date. Currently, I am using Regex Validator that check date in mm/dd/yyyy format.

Need support to check if the date is in yyyy/mm/dd format.


The above regex I am currently using.

  • Welcome to SSE @Abhinav. Can you please elaborate on a problem you are facing ? Is it that none regex works? Or one works and other doesn't... Oct 9, 2023 at 5:28
  • The above regex validate date in mm/dd/yyyy format and is working as expected. I need support to validate in yyyy/mm/dd format and need regex for that.
    – Abhivav
    Oct 9, 2023 at 5:31
  • Btw I faced a similar issue with value not being validated against regex. You can take a look at it as well. sitecore.stackexchange.com/questions/35323/… Oct 9, 2023 at 5:39
  • Checked the above links. The regex is working for me in mm/dd/yyyy format. But I am not able to modify regex to check date is in yyyy/mm/dd format.
    – Abhivav
    Oct 9, 2023 at 5:45
  • Apologies, I misread. Deleted that comment. Please check this link - stackoverflow.com/questions/5247219/… Oct 9, 2023 at 5:48

1 Answer 1


You just need to reorder regex parts like that:


Now year goes first, then month and then day.

  • It worked. Thanks.
    – Abhivav
    Oct 9, 2023 at 6:55
  • Then you can mark the answer as correct.
    – Marek Musielak
    Oct 9, 2023 at 10:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.