title: Match only first and last character of a string
body: <p>I had a look at other <em>stackoverflow</em> questions and couldn't find one that asked the same question, so here it is:</p>
  
  <p>How do you match the first and last characters of a string (can be multi-line or empty).</p>
  
  <p>So for example:</p>
  
  <pre><code>String = "this is a simple sentence"
  </code></pre>
  
  <p>Note that the string includes the beginning and ending quotation marks.</p>
  
  <p>How do I get match the first and last characters where the string begins and ends with a quotation mark (").</p>
  
  <p>I tried:</p>
  
  <pre><code>^"|$" and \A"\Z"
  </code></pre>
  
  <p>but these do not produce the desired result.</p>
  
  <p>Thanks for your help in advance :)</p>