課程
/后端開發
/Python
/python正則表達式
如題?https://regex101.com/?網站下測試能得到9 為什么python環境下得不到?
2017-09-17
源自:python正則表達式 3-3
正在回答
大爺的,沒仔細看。
match(pattern, string, flags=0) ? ?Try to apply the pattern at the start of the string, returning ? ?a match object, or None if no match was found.
意思是必須以符合規則的為開頭
用match方法[1-9]?\d$ 匹配09 時匹配不到9,而用findall可以
用match方法[1-9]?\d$ 匹配sdfdsf09 時匹配不到9,而用findall可以
兩者有什么差別?
舉報
如何使用正則處理文本,帶你對python正則有個全面了解
2 回答為什么re.match(r'[1-9]?\d$', '09')匹配不到
2 回答* 可以匹配 1 次嗎
1 回答匹配的問題
1 回答關于正則匹配
1 回答數字匹配問題
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2017-09-17
大爺的,沒仔細看。
match(pattern, string, flags=0)
? ?Try to apply the pattern at the start of the string, returning
? ?a match object, or None if no match was found.
意思是必須以符合規則的為開頭
2017-09-17
用match方法[1-9]?\d$ 匹配09 時匹配不到9,而用findall可以
用match方法[1-9]?\d$ 匹配sdfdsf09 時匹配不到9,而用findall可以
兩者有什么差別?