title: Find and Replace a URL using Regex
body: <p>I've read few articles and posts but I couldn't find out a solution in removing a specific url from a text. I have tried at least 3 different expressions. It's good to know that I'm doing it programmatically (C#).</p>
  
  <pre><code>(?&lt;!"")((www\.|(http|https|ftp|news|file)+\:\/\/)[_.a-z0-9-]+\.[a-z0-9\/_:@=.+?,##%&amp;amp;~-]*[^.|\'|\# |!|\(|?|,| |&gt;|&lt;|;|\)])(?!"")
  
  ((([A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&amp;=\+\$,\w]+@)?[A-Za-z0-9.-]+|(?:www.|[-;:&amp;=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&amp;;%@.\w_]*)#?(?:[\w]*))?)
  
  (?&lt;!\w?="")(((http|https|ftp|news|file)+://)[_.a-z0-9-]+\.[a-z0-9\/_:@=.+?,##%&amp;‌​amp;~-]*[^.|\'|\# |!|\(|?|,| |&gt;|&lt;|;|\)])
  </code></pre>
  
  <p>The example url is below. Note that not all urls will be exactly like that. This is the worst one.</p>
  
  <p><a href="http://api.ning.com/files/" rel="nofollow noreferrer">http://api.ning.com/files/</a><em>tHd</em>uipNJAW29nIL5jzWbrYON5NhTKYVXmzollyMEHasDDvnq1454BrFkXFfmzj1gH7Ye3xw03C9ulNTICYAdueKg6vaIeu/PauloSkaf.png</p>
  
  <p>Could someone guide me to the solution?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>As <a href="https://stackoverflow.com/users/2206004/hwnd">hwnd</a> mentioned the best pattern is </p>
  
  <pre><code>https?\S+
  </code></pre>