title: PHP preg_replace URL without http, https or www
body: <p>I am not that good with regex and stuff. I know how to change <a href="http://google.com" rel="nofollow">http://google.com</a> and www.google.com into links. However, I want my script to get links around the following strings:</p>
  
  <pre><code>Hello. Have you visited [link goes here]google.com[/link goes here] today?
  Hello. Have you visited [link goes here]www.google.com[/link goes here] today?
  Hello. Have you visited [link goes here]http://google.com[/link goes here] today?
  Hello. Have you visited [link goes here]https://google.com[/link goes here] today?
  </code></pre>
  
  <p>Of course, I would really like the expression to allow as many characters as possible. But for the first link to work, I can only think of one explanation (I don't want people to start writing text.text and it will become a link):</p>
  
  <pre><code>&lt;?php
  $tlds = array("com", "net", "org", "info", "no", "dk", "se");
  foreach($tlds as $tld){
  $string = preg_replace("something", "something", $string);
  }
  ?&gt;
  </code></pre>
  
  <p>Do any of you know what to do? :P</p>
  
  <p>I want it to be similar to Autolinker.js, only in PHP: <a href="https://github.com/gregjacobs/Autolinker.js" rel="nofollow">https://github.com/gregjacobs/Autolinker.js</a></p>