[問題] python Regular Expression 用法
請問一下各位大大
小弟在網路上有找到很多的範例
但是大家在re.match()裡面會加一個r
這個r是什麼意思呢?!
很多範例都有但是好像沒有解釋r是什麼
下面就是範例之一,在re.match裡面的最前面也有一個r那個r是代表什麼意思呢!?
m = re.match(r'www\.(.+)\.com', 'www.google.com')
m.group(0)
# result
'www.google.com'
m.group(1)
# result
'google'
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 59.120.60.93
※ 文章網址: https://www.ptt.cc/bbs/Python/M.1496993586.A.672.html
推
06/09 15:34, , 1F
06/09 15:34, 1F
討論串 (同標題文章)