title: Returning the order number of sub-string in a text
body: <p>I need to parse the string and I am having trouble identifying the order number.</p>
  
  <p>Here few examples with expected answer. I need Oracle SQL expression to ruturn the value</p>
  
  <pre><code>SOURCE_COLUMN      PARAMETER         RETURN_VALUE
  AAA_BBB_CCC_DDD    AAA               1
  AAA_BBB_CCCC_DDD   BBB               2
  AAA_BBB_CC_DDD     CC                3
  AAA_BBBB_CCC_DDD   DDD               4
  AAA_BBB_CCC_DDD    EEE               0
  </code></pre>
  
  <p>Here is SQL to generate first two columns</p>
  
  <pre><code>select 'AAA_BBB_CCC_DDD' SOURCE_COLUMN, 'AAA' PARAM FROM DUAL UNION ALL
  select 'AAA_BBB_CCCC_DDD' SOURCE_COLUMN, 'BBB' PARAM FROM DUAL UNION ALL
  select 'AAA_BBB_CC_DDD' SOURCE_COLUMN, 'CC' PARAM FROM DUAL UNION ALL
  select 'AAA_BBBB_CCC_DDD' SOURCE_COLUMN, 'DDD' PARAM FROM DUAL UNION ALL
  select 'AAA_BBB_CCC_DDD' SOURCE_COLUMN, 'EEE' PARAM FROM DUAL
  </code></pre>