V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
jwu
V2EX  ›  问与答

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

  •  
  •   jwu · Aug 5, 2013 · 3496 views
    This topic created in 4648 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   ·   1133 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 23:05 · PVG 07:05 · LAX 16:05 · JFK 19:05
    ♥ Do have faith in what you're doing.