title: Escaping a single quote in Oracle regex query
body: <p>This is really starting to hurt!</p>
  
  <p>I'm attempting to write a query in Oracle developer using a regex condition</p>
  
  <p>My objective is to find all last names that contain charachters not commonly contained in names (non-alpha, spaces, hyphens and single quotes)</p>
  
  <p>i.e.
  I need to find</p>
  
  <pre><code>J00ls
  McDonald "Macca"
  Smithy (Smith)
  </code></pre>
  
  <p>and NOT find</p>
  
  <pre><code>Smith
  Mckenzie-Smith
  El Hassan
  O'Dowd
  </code></pre>
  
  <p>My present query is </p>
  
  <pre><code>select * from dm_name 
  WHERE regexp_like(last_name, '([^A-Za-z -])')
  and batch_id = 'ATEST';
  </code></pre>
  
  <p>which excludes everything expected except the single quote. When it comes to putting the single quote character, the Oracvel SQL Develoepr parser takes it as a literal.</p>
  
  <p>I've tried:</p>
  
  <pre><code>\' -- but got a "missing right parenthesis" error
  ||chr(39)|| -- but the search returned nothing
  '' -- negated the previous character in the matching group e.g. '([^A-Za-z -''])' made names with '-' return.
  </code></pre>
  
  <p>I'd appreciate anything you could offer.</p>