我正在尝试在AM或PM中匹配时间格式.
i.e. 02:40PM 12:29AM
我正在使用以下正则表达式
timePattern = re.compile('\d{2}:\d{2}(AM|PM)')
但它只返回AM PM没有数字的字符串.出了什么问题?
AM
PM
python regex string time
python ×1
regex ×1
string ×1
time ×1