title: Regex to match last character of a string
body: <p>So I have little problem, I need to check in perl if last character in string is "a". I know, that I can do it in this way:</p>
  
  <pre><code>$test = "mama";
  $test2 = substr $test, -1
  </code></pre>
  
  <p>And now just check if $test2 not equal "a". But how can I do this with regex?</p>