Forum Discussion

THE_BLUE's avatar
Icon for Cirrostratus rankCirrostratus
Nov 04, 2021

Parameter Value - Regular Expression

I want to restrict parameter value to accept date only, is below Regular Expression will work? ^([0-2][0-9]|(3)[0-1])(\/)(((0)[0-9])|((1)[0-2]))(\/)\d{4}$
  • Daniel_Wolf's avatar
    Nov 05, 2021

    I found this regex, fits in the 254 character limit and checks:

    1. valid dates
    2. if leap year, then 29.2. is also valid