locked
Regex match date format D.M.YYYY RRS feed

  • Question

  • User-352524747 posted

    I have a regex that matches this date format: YYYY-MM-DD

    http://regexr.com/3ekdg

    I want to change it to match D.M.YYYY and DD.MM.YYYY

    Thursday, November 10, 2016 1:02 PM

Answers

  • User-2057865890 posted

    Hi Dow7,

    You could change like this.

    (?:(?:0?[1-9]|1[0-9]|2[0-9])\.(?:0?[1-9]|1[0-2])|(?:(?:30)\.(?!02)(?:0[1-9]|1[0-2]))|(?:31\.(?:0[13578]|1[02])))\.(?:19|20)[0-9]{2}

    http://regexr.com/3ekk2 

    Best Regards,

    Chris

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, November 11, 2016 7:24 AM