課程
/后端開(kāi)發(fā)
/Python
/python正則表達(dá)式
如題?https://regex101.com/?網(wǎng)站下測(cè)試能得到9 為什么python環(huán)境下得不到?
2017-09-17
源自:python正則表達(dá)式 3-3
正在回答
大爺?shù)?,沒(méi)仔細(xì)看。
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.
意思是必須以符合規(guī)則的為開(kāi)頭
用match方法[1-9]?\d$ 匹配09 時(shí)匹配不到9,而用findall可以
用match方法[1-9]?\d$ 匹配sdfdsf09 時(shí)匹配不到9,而用findall可以
兩者有什么差別?
舉報(bào)
如何使用正則處理文本,帶你對(duì)python正則有個(gè)全面了解
2 回答為什么re.match(r'[1-9]?\d$', '09')匹配不到
2 回答* 可以匹配 1 次嗎
1 回答匹配的問(wèn)題
1 回答關(guān)于正則匹配
1 回答數(shù)字匹配問(wèn)題
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號(hào)-11 京公網(wǎng)安備11010802030151號(hào)
購(gòu)課補(bǔ)貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動(dòng)學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號(hào)
2017-09-17
大爺?shù)?,沒(méi)仔細(xì)看。
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.
意思是必須以符合規(guī)則的為開(kāi)頭
2017-09-17
用match方法[1-9]?\d$ 匹配09 時(shí)匹配不到9,而用findall可以
用match方法[1-9]?\d$ 匹配sdfdsf09 時(shí)匹配不到9,而用findall可以
兩者有什么差別?