我用过
pattern = re.compile(r'(\/\/smtgvs\.weathernews\.jp\/s\/topics\/img\/\d+\/\w+\.[jpng]*)')
查找所有网址,现在我发现有些网址\/\/smtgvs\.cdn\.weathernews\.jp\/s\/topics\/img\/\d+\/\w+\.[jpng]*)')
如何结合这两种模式?我尝试了pattern = re.compile(r'(\/\/smtgvs\[.cdn]*\.weathernews\.jp\/s\/topics\/img\/\d+\/\w+\.[jpng]*)')
这似乎不正确...
答案 0 :(得分:1)
以下模式应该起作用:
\/\/smtgvs\.(?:cdn)*\.*weathernews\.jp\/s\/topics\/img\/\d+\/\w+\.[jpng]*
示例: