每個字元之前都會 match,包含字串結尾 $ 前面的位置Empty matches are included in the result unless theresult unless they touch the beginning of anothermatch.
https://goo.gl/qcxoYj有興趣也可以玩一下 re.findall(r'o*?', s1, re.DEBUG)抓到的空白為標問號的位置 '?a?b?c?' 這樣應該比較清楚就像 re.findall(r'o*?', '') 回傳的不是 empty list更正 空字串 不是空白 XD