title: regex to remove commas between quotes in Oracle 11.2g
body: <p>My code is:</p>
  
  <pre><code>set serveroutput on size unlimited;
  DECLARE
    v_line_unclean   VARCHAR2(32767); -- 32767 BYTES
    v_line_clean     VARCHAR2(32767);
    v_clean_val     VARCHAR2(32767);
    SQLSMT           VARCHAR2(32767);
    v_line_in_record INTEGER;
    pattern varchar2(15) := '("[^"]*"|[^,]+)';
    v_name           VARCHAR2(50);
    v_first_column   VARCHAR2(200);
    EMP_FILE UTL_FILE.FILE_TYPE;
  BEGIN
    DBMS_OUTPUT.ENABLE(9000000);
    EMP_FILE         := UTL_FILE.FOPEN('EGIS_FILE_DIR','TEST.csv','R', 32767); -- open the file from oracle directory
    v_line_in_record := 0;                                         --we skip the first line
    IF UTL_FILE.IS_OPEN(EMP_FILE) THEN
      LOOP
        v_line_in_record := v_line_in_record + 1;
        --DBMS_OUTPUT.PUT_LINE(v_line_in_record);
        BEGIN
          UTL_FILE.GET_LINE(EMP_FILE,v_line_unclean);
          IF v_line_in_record = 1 THEN-- first record here
            DBMS_OUTPUT.PUT_LINE('');
          ELSIF v_line_in_record = 2 THEN-- second record here (header)
            DBMS_OUTPUT.PUT_LINE('');
            DBMS_OUTPUT.PUT_LINE(v_line_unclean);
            v_first_column   := SUBSTR(v_line_unclean,1,instr(v_line_unclean,',',10,1)-1);
            dbms_output.put_line('1st '||REGEXP_SUBSTR(v_line_unclean, '[^,]+', 1, 1));
          ELSE -- body records here);
            SELECT REPLACE(v_line_unclean,'((\)|^).*?(\(|$))|,', '\1')INTO v_line_clean FROM DUAL;
            SQLSMT := 'INSERT INTO SITE_CONFIG_2G VALUES('''||v_line_clean||''')';
            EXECUTE IMMEDIATE SQLSMT;
          END IF;
          COMMIT;
          DBMS_OUTPUT.PUT_lINE(SQLSMT);
        EXCEPTION
        WHEN NO_DATA_FOUND THEN
          DBMS_OUTPUT.PUT_lINE('NO DATA FOUND EXCEPTION');
          EXIT;
        WHEN TOO_MANY_ROWS THEN
          DBMS_OUTPUT.PUT_lINE('TO MANY ROW EXCEPTION');
          EXIT;
        WHEN OTHERS THEN
          DBMS_OUTPUT.PUT_LINE(sqlcode||sqlerrm);
          ROLLBACK;
          EXIT;
        END;--EXCEPTION
      END LOOP;
    END IF;
    UTL_FILE.FCLOSE(EMP_FILE);
  END;
  </code></pre>
  
  <h2><strong>Result</strong> :</h2>
  
  <pre><code>INSERT INTO SITE_CONFIG_2G VALUES('1,gold,benz,2018,1,blue,"34,000,000",6.4,new,CSV')
  INSERT INTO SITE_CONFIG_2G VALUES('2,silver,bmw,2016,1,silver,"51,000,000",6.5,New,CSV')
  INSERT INTO SITE_CONFIG_2G VALUES('3,bronze,range,2017,1,light-blue,"24,000,000",7.8,New,RVS')
  </code></pre>
  
  <p>I would like to remove commas between quotes in <code>"24,000,000"</code> to give me <code>"24000000"</code></p>
  
  <p>Current result is:</p>
  
  <pre><code>3,bronze,range,2017,1,light-blue,"24,000,000",7.8,New,RVS
  </code></pre>
  
  <p>Expected result is:</p>
  
  <pre><code>3,bronze,range,2017,1,light-blue,"24000000",7.8,New,RVS
  </code></pre>