title: How to extract a substring pattern in Postgresql
body: <p>I have a column with a lot of inconsistent strings. Some of them contain a substring with a consistent pattern of <code>'2015mmdd_AB_CD_EFG_(text)_(text)_HIJ'</code> which I would like to extract. I feel this is a cross over case of regexp and a substring command. </p>
  
  <p>My best approach so far has been a rather ugly </p>
  
  <p><code>substring(col_name, '........_.._.._..._.+_.+_...')</code> </p>
  
  <p>which does not end the output as desired, rahter the output is like '(...)_HIJ_blablabla'. </p>
  
  <p>How can I effectively combine pattern recognition and substring selection in this case?</p>