jwu
V2EX  ›  问与答

麻烦能帮我看看这句正则在Python下面怎么无法匹配呢

  •  
  •   jwu · Aug 5, 2013 · 3552 views
    This topic created in 4676 days ago, the information mentioned may be changed or developed.
    regex = re.compile('''<a href="TeacherInfo.asp\?uid=(\d+)"><b>(.*)<\/b><\/a>''')
    regex = re.compile('''<a href="TeacherInfo.asp\?uid=(\d+)"><b>(.*)<\/b><\/a>.*[\s\S]*UId=\d+">(.*)<\/a>''')

    被备注的第一句能够正常匹配,但第二句就不行,但第二句在http://rubular.com/测试能够成功匹配,难道用了什么Python不支持的规则?
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   956 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 20:10 · PVG 04:10 · LAX 13:10 · JFK 16:10
    ♥ Do have faith in what you're doing.