1
的數據是這樣的:爲什麼我的正則表達式找不到結果?
post date='2008-7' postCount='8' viewCount='24308' questionCount='5' answerCount='76' answeredQuestion='5'
,這裏是我的任務代碼:
p1 = re.compile(r"post date")
m1 = p1.search(postline)
if m1:
month = re.search(r'post date="([\d\W]+)"', postline).group(1)
我已經改變這樣的代碼:一個月= re.search(R 「後日期= '([\ d \ W] +)'」,postline)。集團(1),但它仍然不工作:( – AnneS
@安妮看到我的更新。 – Marcus