title: Get url from a text
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/2343177/regex-for-url-including-query-string">regex for URL including query string</a>  </p>
  </blockquote>
  
  
  
  <p>I have a text or message.</p>
  
  <blockquote>
    <p>Hey! try this <a href="http://www.test.com/test.aspx?id=53" rel="nofollow noreferrer">http://www.test.com/test.aspx?id=53</a></p>
  </blockquote>
  
  <p>Our requirement is to get link from a text.We are using following code</p>
  
  <pre><code>List&lt;string&gt; list = new List&lt;string&gt;();
  Regex urlRx = new
  Regex(@"(?&lt;url&gt;(http:|https:[/][/]|www.)([a-z]|[A-Z]|[0-9]|[/.]|[~])*)",
  RegexOptions.IgnoreCase);
  
  MatchCollection matches = urlRx.Matches(message);
  foreach (Match match in matches)
  {
     list.Add(match.Value);
  }
  return list;
  </code></pre>
  
  <p>It gives url but not the complete one.Output of the code is </p>
  
  <blockquote>
    <p><a href="http://www.test.com/test.aspx" rel="nofollow noreferrer">http://www.test.com/test.aspx</a></p>
  </blockquote>
  
  <p>But we need complete url like</p>
  
  <blockquote>
    <p><a href="http://www.test.com/test.aspx?id=53" rel="nofollow noreferrer">http://www.test.com/test.aspx?id=53</a></p>
  </blockquote>
  
  <p>Please suggest how to resolve that issue.Thanks in advance.</p>