Is there a date for example 06.Ver.2016 how to create a regular expression in .NET to search for such a string?

    2 answers 2

    I can assume that the regular will look like this:

    \b(?<day>\d{2})\.(?<month>Сiч|Лют|Бер|Квiт|Трав|Черв|Лип|Серп|Вер|Жовт|Лист|Груд)\.(?<year>\d{4})\b 

    In the day group it will return the day, in the month group it will be the month of the abbreviations listed (I can not vouch for the correctness of the abbreviations found on the Internet), in the year group it is the year.

    Based on 1 2

      It is better to use specialized methods for disassembling dates:

       var date = "06.Вер.2016"; System.Globalization.CultureInfo cultureinfo = new System.Globalization.CultureInfo("uk-UA"); DateTime dt = DateTime.Parse(date, cultureinfo); 
      • ...для поиска такой строки... - Visman
      • Many thanks, maybe the question was originally asked incorrectly, this is what is needed in my case. - Dmitriy Nail