title: Oracle: a query, which counts occurrences of all non alphanumeric characters in a string
body: <p>What would be the best way to count occurrences of all non alphanumeric characters that appear in a string in an Oracle database column.</p>
  
  <p>When attempting to find a solution I realised I had a query that was unrelated to the problem, but I noticed I could modify it in the hope to solve this problem. I came up with this:</p>
  
  <pre><code>SELECT  COUNT (*), SUBSTR(TITLE, REGEXP_INSTR(UPPER(TITLE), '[^A-Z,^0-9]'), 1)
  FROM    TABLE_NAME
  WHERE   REGEXP_LIKE(UPPER(TITLE), '[^A-Z,^0-9]')
  GROUP BY    SUBSTR(TITLE, REGEXP_INSTR(UPPER(TITLE), '[^A-Z,^0-9]'), 1)
  ORDER BY COUNT(*) DESC;
  </code></pre>
  
  <p>This works to find the FIRST non alphanumeric character, but I would like to count the occurrences throughout the entire string, not just the first occurrence. E. g. currently my query analysing "a (string)" would find one open parenthesis, but I need it to find one open parenthesis and one closed parenthesis.</p>