compile的時候加不加re.I好像沒啥區別?
str1="imooc python, Imoocvb, imoocc++"
a1=re.compile(r"imooc").match(str1).string
a2=re.compile(r"imooc",re.I).match(str1).string
好像加不加re.I,對a1和a2的運行結果沒差,都是imooc python, Imoocvb, imoocc++
str1="imooc python, Imoocvb, imoocc++"
a1=re.compile(r"imooc").match(str1).string
a2=re.compile(r"imooc",re.I).match(str1).string
好像加不加re.I,對a1和a2的運行結果沒差,都是imooc python, Imoocvb, imoocc++
2020-03-26
舉報
2020-04-06
它是一個字符串,匹配的都是第一個'imooc', 當然看不出來差別了