python re模块 如果findall 如果返回结果有包含要匹配的模式,(重叠overlaping)则缺少结果

issue: http://bugs.python.org/file16563/regex_test-20100316

html = """
  • page 4
  • """
    reg = 'href=([\"|\']{0,1})(.*?)([\"|\'|>])' imgre = re.compile(reg) imglist = re.findall(imgre,html) print imglist

    结果:
    [(“’”, ‘javascript:location.href=’, ‘”’)]

    期望结果
    有两个href的匹配结果
    page4.html

    这是python的一个bug

    你可能感兴趣的:(python re模块 如果findall 如果返回结果有包含要匹配的模式,(重叠overlaping)则缺少结果)