Extracting URLs from a markdown document

Is there a nice (tested?) way of extracting URLs from an (R)markdown document? I'm trying to avoid writing my own horrible regular expression.

Thanks

1 Like

@csgillespie I don't know of an exact function that can do this. But to avoid a horrible regular expression, you could knit the (R)markdown document to HTML and then extract the anchor tags with rvest.

1 Like

Thanks for the suggestion. Since I was converting to pdf, I just parsed the LaTeX for \url{} which was relatively straightforward.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.