Using preg_replace() with the_content filter

Turns out I had multiple problems, @bonger pointed out the first one and then I found and solved issues with the global flag on the regular expression not being valid in php and me not accounting for links without a / after the .com. Final fix looks like this:

add_filter('the_content', 'linkAppend');

function linkAppend($content) {
  global $referalString;
  $content = preg_replace('/\/\/(www|launch)?\.?(solarwinds\.com)\/?[^"]*/m','$0?cmp='.$referalString, $content);
  return $content;
}