title: Mysql: extract a string from field between delimiters (backwards)
body: <p>I have a Column 'ACCOUNT_NUMBER' from a table 'BankingActivity' which contains data as follow :</p>
  <p>example:</p>
  <pre><code>ManualBanking-BankDeposit-350-1006590343--INTERNAL_A
  </code></pre>
  <p>or</p>
  <pre><code>MyPayCard-MyPayDeposit-620-989228234--TL
  </code></pre>
  <p>I need to extract the number '1006590343' or '989228234'</p>
  <p>Initially i execute the following query:</p>
  <pre><code>select substr(  `BankingActivity`.`ACCOUNT_NUMBER`,(
      locate( '--', `BankingActivity`.`ACCOUNT_NUMBER` ) - 9  ),9 ) * 1 
  from BankingActivity
  </code></pre>
  <p>Which works fine if the length of the string does not exceed 9 digits. Over 9 digits, I obviously have issues and can not get the full string.</p>
  <p>How can i look backwards for the delimiter '--' and then extract the value between the '--' delimiter and the previous '-' delimiter?</p>
  <p>I tried with some Regex but I am not familiar enough with it to get a correct result.</p>