Relative Content

Tag Archive for regexpython-repython-regex

How to match Chinese Date for with or without Month adn time?

I have some date in Chines format, I tried pattern r'(d{1,2})月(d{1,2})日(d{0,4})时?至(d{0,2})月?(d{1,2})日(d{0,4})时?', it is not correct so I asked ChatGPT and I got r'(d{1,2})月(d{1,2})日(?:d{0,4}时?)?至(?:((d{1,2})月)?(d{1,2})日)(?:d{0,4}时?)?', I run code as below: