title: regex extract string between single quotes trim whitespace
body: <p>I'm trying to use regex to extract a string between single quotes and trim any preceding or trailing whitespaces. I'm able to extract the string in between the single quotes using <code>(?&lt;=')[^']+(?=')</code> however, it's the trim bit I am struggling with.</p>
  
  <p>String: 
  <code>message sent from '  joe bloggs     '</code>. </p>
  
  <p>I'd like the result extracted by regex to be:
  <code>joe bloggs</code></p>