Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我从抓取的页面中有这种值,我想通过正则表达式获取它:
4:00pm 16th-17th 1:30am
我有这个表达来处理时间,它工作正常:
([1-9]|1[012]):[0-5][0-9](am|pm)
有没有办法有一个单一的正则表达式,我还可以包含16th-17th的匹配
(([1-9]|1[012]):[0-5][0-9](am|pm))|(\d{1,2}(st|nd|rd|th)-\d{1,2}(st|nd|rd|th))