I know this is a solved thread but I thought it presented a good opportunity to further the discussion in regards to regular expressions.
Php allows Perl style regex declarations which are contained within / and /
"\" on the other hand is used to scape characters such as quotation marks etc.
Another important point to make is that when using regex for validation routines make sure to start your regex with the anchor /^ and end them with \z/ instead of $/ which fails to mark the real end of the expression, leaving it vulnerable.
In regards to your code, this should work:
$content = preg_replace("/href=.*/", "href=\"string\"", $content);
For a good regex tutorial to start you off please visit here