Note that there are some explanatory texts on larger screens.

plurals
  1. POextract all urls from a string
    primarykey
    data
    text
    <p>I have a string of text that contains html, and I need to extract each url (most likely in img or a tags) to create a generic list of string objects. I only want the urls from inside html tags, not in the text. Is there an easy way to do this or will I have to resort to regular expressions?</p> <p>If I have to resort to regular expressions, would you mind helping me out with that as well? :)</p> <p><strong>UPDATE:</strong> To answer Seph, the input will be standard html.</p> <pre><code>&lt;p&gt;This is some html text. my favourite website is &lt;a href="http://www.google.com"&gt;google&lt;/a&gt; and my favourite help site is &lt;a href="http://www.stackoverflow.com"&gt;stackoverflow&lt;/a&gt; and i check my email at &lt;a href="http://www.gmail.com"&gt;gmail&lt;/a&gt;. the url to my site is http://www.mysite.com. &lt;img src="http://www.someserver.com/someimage.jpg" alt=""/&gt;&lt;/p&gt; </code></pre> <p>And I want</p> <ul> <li><a href="http://www.google.com" rel="nofollow noreferrer">http://www.google.com</a></li> <li><a href="http://www.stackoverflow.com">http://www.stackoverflow.com</a></li> <li><a href="http://www.gmail.com" rel="nofollow noreferrer">http://www.gmail.com</a></li> <li><a href="http://www.someserver.com/someimage.jpg" rel="nofollow noreferrer">http://www.someserver.com/someimage.jpg</a></li> </ul> <p>the end result should be All urls in any html tag, ignoring those are are "plain text"</p> <p><strong>UPPERDATE</strong> Although he deleted his answer, I want to thank Jerry Bullard for bringing to my attention Regex Buddy (<a href="http://www.regexbuddy" rel="nofollow noreferrer">http://www.regexbuddy</a>). I wanted to upvote your answer but its gone. Bring it back and you get a vote!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload