title: Perl regex - match the previous character
body: <p>I want to be able to do a regex on a string to add a backslash before a double quote, only when it doesn't already have a backslash before it.  So the function (e.g. regex_string) would have the output -</p>
  
  <pre><code>$my $string_1 = 'A "sentence';
  regex_string($string_1); # Would equal 'A \"sentence'.  A backslash was added as one was not present.
  
  $my $string_2 = 'A \"sentence';
  regex_string($string_1); # Would equal 'A \"sentence'.  A backslash is not added because one already existed.
  </code></pre>
  
  <p>Can anyone help with how the regex should look?  Thanks</p>