Help parse this time: such parameters are of interest to the printer name and installation date

HP_LaserJet aceepting requests since Вт. 28 февр. 2017 17:49:12 HP_LaserJet aceepting requests since Вт. 28 февр. 2017 17:49:12 
  • and what, the data in the line must be duplicated? - mymedia
  • No, it is not necessary, the printer name and date can be any - Nikola Krivosheya
  • Why are there any regular expressions here? Enough regular scanf / sscanf - avp

1 answer 1

The regular expression for your string looks like this:

 [^ ]+\ aceepting\ requests\ since\ (?:Пн|Вт|Ср|Чт|Пт|Сб|Вс)\.\ \d+\ (?:янв|февр|март|апр|май|июнь|июль|авг|сен|окт|нояб|дек)\.?\ \d{4}\ \d{1,2}\:\d{1,2}\:\d{1,2} 

Working example: https://regex101.com/r/xWB0u4/1