What is a regular expression for checking a month with a leading zero?
Skip regex:
01,02,03,04,05,06,07,08,09,10,11,12
The regex does not work:
1, 00, 13 and up.
/^(0[1-9]|1[0-2])$/
/^01|02|03|04|05|06|07|08|09|10|11|12$/
I think this is better, it accepts "05", but also "5" per month:
/(^0?[1-9]$)|(^1[0-2]$)/
it will work
/(0[1-9])|(1[012])/
Source: https://habr.com/ru/post/1746477/More articles:Serializing RSS feed data in ASP.NET - c #Setting ComboBox DropDown Width in C # - c #Associate an object with WPF TreeView - c #Exception in thread "main" org.jboss.xb.binding.JBossXBRuntimeException: Failed to create new SAX parser - javaHow is the implicit segment register of the nearest pointer defined? - assemblyЗапуск щелчка с помощью jQuery для использования функции кода, не работающей в 1.4. Работа выполнена в 1.3.2 - jqueryGeneric circular addiction - genericsSeparate the last line from a text file - c #Multiple inheritance from a template class - c ++top-k selection / merge - algorithmAll Articles