Golang - 使用正则表达式提取链接我需要example.de在 Go 中使用 Regex从特定域中的文本获取所有链接以下是应提取的所有可能链接:https://example.de
https://example.de/
https://example.de/home
https://example.de/home/
https://example.de/home some text that should not be extracted
https://abc.example.de
https://abc.example.de/
https://abc.example.de/home
https://abc.example.de/home
https://abc.example.de/home some text that should not be extracted我已经尝试过的我使用这个网站来检查我的正则表达式是否正确: https ://regex101.com/r/ohxUcG/2 以下是失败的组合:https?://*.+example.de*.+表达失败,https://abc.example.de/a1b2c3 dsadsa将整个文本转移到\n而不是https://abc.example.de/a1b2c3没有dsadsahttps?://*.+example.de*.+\s(\w+)$这会获取仅以空格终止的链接,但有时链接可以以\n或\t等终止。
- 1 回答
- 0 关注
- 257 浏览
添加回答
举报
0/150
提交
取消