title: Regular expression in PL/SQL
body: <p>I am using a regular expression to find out whether the user entered value is alpha numeric, allowing some special characters.</p>
  
  <p>I am using the following code which works fine:</p>
  
  <pre><code>CREATE OR REPLACE PROCEDURE Validate_Inputstring (input_String IN VARCHAR2) AS
  BEGIN
  
    IF REGEXP_LIKE(input_String,'^[A-Z0-9a-z,+-?@]*$') THEN 
        DBMS_OUTPUT.PUT_LINE('U have entered alphanumeric chars---&gt;'|| input_String);
      ELSE
        DBMS_OUTPUT.PUT_LINE('U NOT have entered alphanumeric chars----&gt;'|| input_String);
    END IF;
  END;
  </code></pre>
  
  <p>The above programs works fine.<br>
  Now my poblem is these special symbols are dynamic and these values vary upon the application.</p>
  
  <p>In other words, these are stored in the database and different for each application.</p>
  
  <p>For example, for application A these might be <code>, + - ? @</code>, for B these might be <code>{ ^ &amp; '</code>.</p>
  
  <p>Is it possible to write a regular expression such that it checks for alphanumeric chars and these dynamic special symbols at a time?</p>
  
  <p>I have tried something like</p>
  
  <pre><code>CREATE OR REPLACE PROCEDURE Validate_Inputstring (input_String IN VARCHAR2) AS
      special_symbols     VARCHAR2(300);
  
  BEGIN
      special_symbols :=',+-?';
      IF  REGEXP_LIKE(input_String,'^[A-Z0-9a-zspecial_symbols]*$') THEN 
          DBMS_OUTPUT.PUT_LINE('U have entered alphanumeric chars---&gt;'|| input_String);
        ELSE
          DBMS_OUTPUT.PUT_LINE('U NOT have entered alphanumeric chars----&gt;'||    input_String);
      END IF;
  END;
  </code></pre>
  
  <p>but it doesn't work.  Does anyone have a solution for this? Thanks in advance!</p>