title: Postgresql: How to use Substring with Regex?
body: <p>I want to use a substring in a <code>CASE</code> statement that if it returns <code>true</code> then it will return whatever is in the <code>THEN</code> clause, such as:</p>
  
  <pre><code>CASE
  WHEN substring(name, '\d\s\d{8}') THEN 'Long Name'
  END
  </code></pre>