I have some HTML that looks like this:
<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>
using
m<-regexpr("http://\\S*/?", links, perl=T)
links<-regmatches(links, m)
gets me the links, except the ones with dashes in them are truncated like this:
http://www.website.com/index.aspx
http://website.com/index.html
http://www.website
http://website2.org/index.htm
http://www.another-site.com/
I thought /S matched any non-whitespace. What's going on?