title: How to use PATINDEX in SQL Server?
body: <p>In SQL Server 2012, I have a column which has long text data. Somewhere within the text, there is some text of the format</p>
  
  <pre><code>{epa_file_num} = {138410-81}
  </code></pre>
  
  <p>If it exists, I want to extract out <code>138410-81</code> as a column value. In regular JS regex, I would use something like this <code>{ *epa_file_num *} *= *{ *\d*-?\d* *}</code> to match the column, and then maybe a capturing group to get the value. </p>
  
  <p>But how can I get it in SQL Server 2012?</p>
  
  <p>Thanks</p>