title: preg_replace is only replacing part of the input? ( Regex Help )
body: <p>I have this function which is used for BBcodes on my site. I am using preg_replace.</p>
  
  <pre><code>function makebbcode($bbpost) {
      $bbfind = array(
          '~\@(.*?)~s'
      );
      $bbreplace = array(
          '&lt;a href="http://www.google.com"&gt;@$1&lt;/a&gt;'
      );
      $bbpost = preg_replace($bbfind, $bbreplace, $bbpost);
      //Once BBcodes and icons are put in, return.
      return $bbpost;
  }
  </code></pre>
  
  <p>The point of this is to make it so you can put @username and it becomes a link to their profile. ( www.google.com is a test example. ) But the code is just making the @ symbol a link, rather than the whole @username. </p>
  
  <p>That being said, it looks like it's completely ignoring (.*?) for some reason. I'm sure my regex is off, but I can't figure out exactly what IS off, and I couldn't find anything online that could help... or at least something I could understand. ( Beginner at regex )</p>