title: Convert 'regexp_instr' (ORACLE) to equivalent in POSTGRESQL
body: <p>I came across an Oracle function when converting Oracle schema to Postgresql 12 as following:</p>
  <pre><code>varColName := upper(substr(inColumnDdl, regexp_instr(inColumnDdl, regMatch, 1, 1, 0, 'i', 1), regexp_instr(inColumnDdl, regMatch, 1, 1, 1, 'i', 1)-regexp_instr(inColumnDdl, regMatch, 1, 1, 0, 'i', 1)));
  </code></pre>
  <p>with the line : <code>regexp_instr(inColumnDdl, regMatch, 1, 1, 1, 'i', 1)-regexp_instr(inColumnDdl, regMatch, 1, 1, 0, 'i', 1)))</code></p>
  <p>regexp_instr gives the position of the last char in the occurence  - the position of the first char in the occurence</p>
  <p>how can i do the same with probably strpos and regexp_match in postgresql, if you have any other idea instead strpos and regexp_match please tell me</p>
  <p>an example : regexp_instr('stack', 'tac', 1, 1, 1, 'i', 1)-regexp_instr('stack', 'tac', 1, 1, 0, 'i', 1))). the first regexp_instr returns the value 4 which is the position of the last character of the occurence 'tac' in stack'.  AND the second regexp_instr returns the value 2 which is the position of the first character of the occurence 'tac' in stack' so the first regexp_instr - the second regexp_instr gives 4 - 2 = 2</p>