title: Oracle REGEXP_LIKE lookahead and lookbehind workaround
body: <p>I am struggling to build a regexp_like statement that will work in Oracle. I need to compare a series of rows, each of which has a field that contains a comma-delimited set of numbers. (always numbers). I need to activate and inactivate accounts (daily) based on how these numbers change.</p>
  <p>Here are several samples of the fields. (each row below is the result in the field)</p>
  <pre><code>9,18,31,32,50,725
  17,20,31,32,50,725
  17,18,20,22,50,725
  9,18,31,49,50,500
  49,22,9,25,222
  18,18,31,9,50,725
  49,31,9,25,292
  </code></pre>
  <p>I need to find any row that has one or more of the following numbers. 9, 20, 22, 50. (Other places in the code may need only 9 or only 20 and 22. But the principle holds. If the number is 500, it cannot be selected. It must be 50.</p>
  <p>The following regular expression works in python, in my notepad++ search, and in an online regex builder:</p>
  <pre><code>((?&lt;![1-9])9|(?&lt;![1-9])20(?![1-9])|(?&lt;![1-9])22(?![1-9])|(?&lt;![1-9])50(?![1-9]))
  </code></pre>
  <p>It relies on negative lookahead and negative lookbehind. But because Oracle doesn't support lookaround, I'm stumped.</p>
  <p>Here is a piece of sample code which works if I use regexp without lookaround.</p>
  <pre><code>DECLARE 
  v_search_string    varchar2(60);
  BEGIN
  v_search_string := '49,31,9,25,50,292';
  
  IF REGEXP_LIKE( v_search_string, '((?&lt;![1-9])9|(?&lt;![1-9])20(?![1-9])|(?&lt;![1-9])22(?![1-9])|(?&lt;![1-9])50(?![1-9]))')
      THEN
          dbms_output.put_line('Yes');
      ELSE
          dbms_output.put_line('No');
  END IF;
  --dbms_output.put_line('Yes');
  END;
  </code></pre>
  <p>In this case, I should get 'Yes' in my dbms_output because it should match '50'.</p>
  <p>Any thoughts?
  P.S. I'm open to someone saying, &quot;hey, silly, it would be easier to do THIS.&quot;</p>