title: Possible to create Oracle regular expression that's able to match NULL?
body: <p>In Oracle, is it possible to match both a particular string format and an empty string using a single regex?</p>
  
  <p>Something along the lines of:</p>
  
  <pre><code>SELECT 1
    FROM DUAL
   WHERE REGEXP_LIKE('12345', '^([1-5]{5})|NULL$');
  
  SELECT 1
    FROM DUAL
   WHERE REGEXP_LIKE('', '^([1-5]{5})|NULL$');
  
  SELECT 1
    FROM DUAL
   WHERE REGEXP_LIKE(NULL, '^([1-5]{5})|NULL$');
  </code></pre>
  
  <p>where the 'NULL' portion of the regex is treated as a character class rather than a string literal and all three queries return 1.</p>
  
  <p>I'm writing some data validation routines and would like to store/use just one regex to determine both the format and whether the input string can be empty -- rather than specifying those validation rules seperately for each data element.</p>
  
  <p>Thanks,
  Jeff</p>