title: extract delimited substring from field from arbitrary positions in the field using SQL
body: <p>I'm trying to extract the following substring from the following field that contains strings delimited by underscores, where the substring may not be in the same location in every cell</p>
  
  <pre><code>a_bsdf_cat123_adsd_esdf
  a_cat345_zasd_weaq
  cat123213_sdfa_sadfas_23dsafa
  z_cat987_cat123_sdfaef
  </code></pre>
  
  <p>I would like the extract the first underscore delimited substring starting with the letters "cat".  So in the above example, I would like to extract</p>
  
  <pre><code>a_bsdf_cat123_adsd_esdf             -&gt; cat123
  a_cat345_zasd_weaq                  -&gt; cat345
  cat123213_sdfa_sadfas_23dsafa       -&gt; cat123213
  z_cat987_cat123_sdfaef              -&gt; cat987
  </code></pre>
  
  <p>I know how to extract a substring using the substr() and instr() functions, but not when it is in different locations within the field.  How can that be done?</p>
  
  <p>I need to extract this from both Oracle and MySQL.</p>