sample:<a rpos="" cpos="title" href="http://xxx.com/a.html" style="font-family:Arial,SimSun,sans-serif;font-size:16px;color:#0000cc; text-decoration:none;" target="_blank">
我想获取http://xxx.com/a.html 请问如何写正则表达式
sample:<a rpos="" cpos="title" href="http://xxx.com/a.html" style="font-family:Arial,SimSun,sans-serif;font-size:16px;color:#0000cc; text-decoration:none;" target="_blank">
我想获取http://xxx.com/a.html 请问如何写正则表达式
这还不简单
text = '<a rpos="" cpos="title" href="http://xxx.com/a.html" style="font-family:Arial,SimSun,sans-serif;font-size:16px;color:#0000cc; text-decoration:none;" target="_blank">'
urlPattern = r'(href="http://[\s\S]+.html")'
pattern = re.compile(urlPattern)
match = re.findall(pattern,text,0)
4 回答4.5k 阅读✓ 已解决
1 回答3.3k 阅读✓ 已解决
4 回答3.8k 阅读✓ 已解决
3 回答2.2k 阅读✓ 已解决
1 回答4.5k 阅读✓ 已解决
1 回答3.9k 阅读✓ 已解决
1 回答2.8k 阅读✓ 已解决