次のような HTML があります。
<ul><li><a href="http://www.website.com/index.aspx" target="_blank">Website</a></li>
<li><a href="http://website.com/index.html" target="_blank">Website</a></li>
<li><a href="http://www.website-with-dashes.org" target="_blank">Website With Dashes</a></li>
<li><a href="http://website2.org/index.htm" target="_blank">Website 2</a></li>
<li><a href="http://www.another-site.com/">Another Site</a></li>
使用して
m<-regexpr("http://\\S*/?", links, perl=T)
links<-regmatches(links, m)
リンクを取得しますが、ダッシュが含まれているものは次のように切り捨てられます。
http://www.website.com/index.aspx
http://website.com/index.html
http://www.website
http://website2.org/index.htm
http://www.another-site.com/
/S は空白以外のすべてに一致すると思いました。どうしたの?