0
我想使用NSRegularExpression
获取html中的所有下载链接。NSRegularExpression获取html内容中的所有下载链接
例如HTML内容是这样的:
<a href="http://xxxx.com/file.mp3">text info</a>
,我想这样的所有字符串:
href="http://xxxx.com/file.mp3"
现在我使用这种模式:
NSString *pattern = @"(?<=href=\").+?\\.(mp3)";
但它不能很好地工作。
相关:http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/1732454#1732454 –
你究竟是什么意思?“它不起作用这么好“?你有任何测试用例吗? – Monolo