我正在尝试提取链接,使用命令为:
这是命令:
但这也没有起作用;sed开始了但没有退出,并且按键时它们被回显但没有其他反应。
sed /http.*.torrent/s/.*(http.*.torrent).*/\1/;/http.*.torrent/p 1.html
。然而,由于sed缺乏非贪婪量词(这是因为在行尾的地方再次出现了“torrent”),我尝试将其转换为perl。但我需要perl的帮助。(或者如果您知道如何使用sed完成它,请告诉我。)现在我需要添加这部分内容,将其从sed转换过来:/http.*.torrent/p
。这是命令:
sed /http.*.torrent/s/.*(http.*.torrent).*/\1/;/http.*.torrent/p 1.html
中的一部分。但这也没有起作用;sed开始了但没有退出,并且按键时它们被回显但没有其他反应。
This is an example of a matching line, other can be anything: <a href="https://toPB.torrent" title="Download this torrent"> The goal is to extract https://toPB.torrent for each such line.
- ccvn.torrent
链接?如果是这种情况,你可能需要深入研究HTML::TreeBuilder。 - ssapkota