title: regexp_like that mirrors contains near
body: <p>I'm trying to speed up a query that uses Contains Near with one that uses regexp_like.  The initial Contains Near query takes about 45 minutes to run.  Clob Column holds large "documents" and is domain indexed.  </p>
  
  <p><strong>Initial query:</strong></p>
  
  <pre><code>SELECT column1
  FROM TEST
  WHERE CONTAINS(column1,'{NEAR(quick,fox, lazy), 3, FALSE}')&gt;0;
  </code></pre>
  
  <p><strong>Proposed query:</strong></p>
  
  <pre><code>SELECT column1
  FROM TEST
  WHERE REGEXP_LIKE(column1, '(\b(quick|fox|lazy)(?:\W+\w+){1,6}?\W(quick|fox|lazy)(?:\W+\w+){1,}?\W(quick|fox|lazy)\b)','i')
  </code></pre>
  
  <p>I got the original regexp syntax from here:
  <a href="https://www.regular-expressions.info/near.html" rel="nofollow noreferrer">https://www.regular-expressions.info/near.html</a>.</p>
  
  <p><strong>Problem:</strong>
  I get the regexp code to work in html <a href="https://www.regextester.com" rel="nofollow noreferrer">https://www.regextester.com</a>, but when I put it in Oracle it doesn't find anything.  What is wrong with my syntax?  I can't figure it out.   Does Oracle handle REGEXP differently? </p>