regexp_replace

Hi all

I want to replace everything from a string that contains only words with two digits that begins with D and ends with any vogal.

regexp_replace (' DETR - DET of AND DA WTHI END ', ' ^ D(A|)) E | I have | O | ((U)') of double

I wish

"DETR - DET AN AND WTHI END '."


Kind regards

can you explain the formula, please?

(^|\s+) (D [AEIOU]) (\s+|$)

(^ | \s+): this group is the beginning of the string or a sequence of one or more whitespace (s)

(D [AEIOU]): this group corresponds to the letter D followed by A, E, I, O or u.

(\s+|$): this group is the end of the string or a sequence of one or more whitespace (s)

Thus, the whole expression Mashes your 2 letter word target and surrounding whitespace (s) if necessary.

The third REGEXP_REPLACE argument tells the function to keep the first (\1) and third group (\3) in the output, but do not know the 2nd.

Tags: Database

Similar Questions

  • How to use regexp_replace to replace strings instead of substrings in commas

    I have a table that has a column that contains the strings separated by columns. For example

    Tbl1

    ===========

    ID || Col1

    1 A-B-C, B - C, A-B-C

    I use select ID, regexp_replace (Col1, ' ([^,] +), \1', '\1') of tbl 1

    and I get

    Tbl1

    ===========

    ID || Col1

    1 A-B-C

    I'm looking for is

    Tbl1

    ===========

    ID || Col1

    1 A-B-C, B - C

    Why is my regular expression matching chain also instead of match the whole string? Thank you!

    You try to delete the duplicates?

    with tbl (ID, Col1) as long as)

    Select 1, 'A-B-C,B-C,A-B-C' of all the double union

    Select 2, 'A-B-C,B-C,A-B-C,B-C,E-F-G,E-F-G' of the double

    )

    SELECT id, listagg (str, ',') within the Group (order by lvl) as NewCol1

    de)

    Select r.*, row_number() over (partition by id, order of str from lvl) rn

    de)

    Select the level lvl, id, regexp_substr (Col1, ' [^,] +', 1, level) Str

    from tbl

    connect by level<= regexp_count(col1,="" ',')="" +="" 1="">

    ID = prior id and

    prior sys_guid() is not null - prevent connect loop using unique val

    + 0

    )

    where rn = 1

    Group by id

    ID NEWCOL1
    1 «A-B-C, B - C»
    2 'A-B-C,B-C,E-F-G '.
  • helps the regexp_replace - converting numbers to strings

    I try to use regexp_replace replace all occurrences of the type (number) (in brackets with a number inside) with the expression ('number') (add "before and after the number, and by here - to transform the number to varchar).

    I can't find a way to do it properly.

    It would be great if you guys could help out me here.

    Example-

    Before change: abcde (737) (6) s (v) sbsgs37

    After change: abcde('737') s sbsgs37('6') (v)

    Thank you

    Ilya Golosovsky.

    ("Select REGEXP_REPLACE (' abcde (737) (6) s (v) sbsgs37 ', '\((\d+)\) ', q '[('\1 ')]')

    of qry

    Result:

    ABCDE('737') s sbsgs37('6') (v)

    q "[.. '] is called a string q, it allows us to embed single quotes in string literals without having to get away from them."

    \((\d+)\)

    • ------(corresponds to the character (literally
    • 1 capturing group (\d+)
      • \d+ matches a digit [0-9]

        • Quantifier: + between one and unlimited times, as many times as possible, giving necessary [greedy]
    • \) corresponds to the character) literally

    ('\1')

    • 1 capturing group ("\1")

      • literally "corresponds to the character.
      • \1 matches the text even more recently matched by the capturing group 1
      • literally "corresponds to the character.
  • Need to separate the line using regexp_replace, when there is no string "&lt; BR &gt;".

    Hello

    This is the first time I post on this forum.  Currently I have some data in a column, for example:

    AMF PICK STITCHING 1/16 < BR > NO CUSTOM IMITATION BTNHOLE < BR > < BR > TAG

    What I want to do is to divide it when it hits < BR > he actually makes a new line and removes the < BR >, so it should eventually appear as follows:

    AMF PICK STITCH 1/16

    NO IMITATION BTNHOLE

    CUSTOM LABEL


    I have the following, but it does not work:


    with the trial as

    (select 'AMF PICK STITCH 1/16 < BR > No. IMITATION BTNHOLE < BR > LABEL PERSONALIZED < BR > ' double str)

    )

    Select regexp_substr (str, ' [^ < BR >] +', 1, rownum) alteration

    of the test

    connect by level < = length (regexp_replace (str, ' [^ < BR >] + "")) + 1

    I am currently on Oracle 11 g and PL/SQL developer coding.

    It is not quite clear what you want.

    Either you want 3 lines or a line with 3 breaks.

    [^
    ] May not be what you want it to be.

    It defines a list of characters is not a match.

    Thus, each <,>, B, R, would be a step match independently as part of the
    .

    What you might try is:

    Select regexp_substr (str '(.*?)
    1, level, null, 1) alteration

    of the test

    connect by level<= regexp_count="" (str,="">
    ')

    If you want 3 ranks as the result.

  • REGEXP_REPLACE - replaceing a character not allowed

    Hi friends,

    Please, help me to replace a character not allowed of a given string. Allowed characters are

    abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789/ -?: ()., "+ {space} "


    If a character in the specified string is not in the list above, which should be replaced by a space. Can you please help me to do with REGEXP or in any other way.


    Thanks in advance!

    In my previous solution the dash (-) in the second row replaced with space. That shouldn't be the case. This is because the brackets, hyphen is considered operator of range as [0-9]. So I moved the link to the last to solve the problem.

    SQL> with t
      2  as
      3  (
      4    select 'ka{th}ck' str from dual union all
      5    select 'k$rt-ic)' str from dual union all
      6    select 'k$rthi@k' str from dual union all
      7    select 'KARTHI123' str from dual
      8  )
      9  select str
     10       , regexp_replace(str, '[^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789/?:().,''+{}-]', ' ') new_str
     11    from t;
    
    STR       NEW_STR
    --------- ----------
    ka{th}ck  ka{th}ck
    k$rt-ic)  k rt-ic)
    k$rthi@k  k rthi k
    KARTHI123 KARTHI123
    
  • Why doesn't my REGEXP_REPLACE?

    Select count (*) from PRX. PROX_REQ where status = "ERROR" and REQUEST_BODY like ' % < country > Germany < / country > %';

    > 66

    update of PRX. PROX_REQ set REQUEST_BODY = REGEXP_REPLACE (REQUEST_BODY, '< country > Germany </country >', '< country > Deutschland/< country >') where status = "ERROR";

    > 102 lines updates

    which is wrong with my order? It should update the 66 lines and not 102!

    I want to replace < country >Germany< / country > with < country >Germany< / country > in the table PRX. PROX_REQ and the request_body column

    ... < / Street > < Home > 6 number < / house number > < Zip > 21073 < / Zip > < City > Hamburg < / City >< country > Germany < / country >< / ShipToAddress > < HardwareRequired > true < / HardwareRequired > < DeliveryIdentificationType > STANDARD < / DeliveryIdentificationType > < / HardwareDetails > < SendContractDocument > false < / SendContractDocument > < SendConfirmationFax > false < / SendConfirmationFax > < TrustedShopAmount > < amount > 7.49 < / amount > < currencies > EUR < / currency > < / TrustedShopAmount >...

    Help, please...

    Thanks in advance

    Update...

    Set request_body = regexp_replace (...), status = 'OK '.

    When status = ' ERROR and request_body_like «...» »

  • Help REGEXP_REPLACE

    Hi all

    I tried to replace the characters all before X.

    For example, in this case, the X is replaced by 0

    Select REGEXP_REPLACE (12X99999', '[Aa - Zz]','0 ') of the double

    120to 99999

    I want to replace 12 X 0, so I want to replace 12X99999 and see 00099999.


    Can someone help me?

    Thank you.

    Select RPAD ('0', REGEXP_INSTR(s,'[A-Za-z]'),'0 '). REGEXP_REPLACE(s,'.+[A-Za-z]') of

    (SELECT "12 X 99999" s FROM DUAL ")

  • REGEXP_REPLACE remove the comma in double quotes

    Hello

    I am trying to remove the comma of a string in double quotes, currently I can only remove a comma using under sql

    SELECT REGEXP_REPLACE (' "" A, B, C, def "', '(") ([^ "|,"] +) (,) ([^ ""] +) ("") ',' \1\2 \4\5' ') FROM DUAL;

    output: 'A B, C, def'

    But I need the form "A B C def".

    Hello

    Jarkko Turpeinen wrote:

    ... I think that I stop to answer here, because I don't understand of course questions

    Very understandable.  If my assumption is correct, the question would be much clearer if OP gave an example that included a few commas inside the quotation marks and some outside, as in the example below.

    Here's a way to implement what I have described in the answer #2 above:

    VARIABLE input_txt VARCHAR2 (100)

    EXEC: input_txt: = 1, '2', ' A, B, C, def ", 3" foo, bar '4 ';

    WITH got_parts AS

    (

    SELECT LEVEL AS part_num

    , REGEXP_SUBSTR (: input_txt)

    , '[^"]*("|$)'

    1

    LEVEL

    ) AS part_txt

    OF the double

    CONNECT BY LEVEL<= 1="" +="" regexp_count="" (="">

    , '"'

    )

    )

    SELECT LISTAGG (CASE

    WHEN MOD (part_num, 2) = 0

    THEN REPLACE (part_txt, ',')

    Of OTHER part_txt

    END

    ) Within AS output_txt GROUP (ORDER BY part_num)

    OF got_parts

    ;

  • A question about regexp_replace

    Convert the string "This is a test" to "This is a test" using backreference expression


    db > select regexp_replace('This is a test', '(^[[:alpha:]]+) ([[:alpha:]]{2})', '\2......\1') OUTPUT from dual;
    OUTPUT
    -------------------
    is......This a test
    

    Fell on the regular expression above and after having made a few of them, this one threw me. It was on paper and the response that works leaves scratching me my head as to why it works at all.

    (^ [[: alpha:]] +)

    I interpret this as saying... .to find the start of a string of alpha one or several characters in this case "it."

    ([[: alpha:]] {2})

    and I interpret this As... to the point that expression (^ [[: alpha:]] +) had stopped, look for alpha pair "istest".

    and then swap them... 'istestThis '.

    I'm obviously completely wrong interpret this so any help appreciated.

    ' (^ [[: alpha:]] +)'(^[[:alpha:]]+)

    (^ [[: alpha:]] +)

    (^ [[: alpha:]] +)

    Hello

    Gusora wrote:

    DB > select regexp_replace ('This is a test', ' ([[: alpha:]] {2})', 'x') twice;

    REGEXP_RE

    ---------

    x xx a xx

    When you call REGEXP_REPLACE with onoy 3 arguments, then all occurrences of the 2 argument will pass to the argument 3.

    How many times is the model ' ([[: alpha:]] {2})' occur in "this is a test"?  5 times.

    1. "Th".
    2. 'East' (starting at position 3)
    3. 'East' (starting at position 6)
    4. 'you' and
    5. "st."

    all match the pattern ' ([[: alpha:]] {2})', so they are all replaced by 'x '.

    So, how ' ([[: alpha:]] {2})' operates here where he will continue to search until the end of the string is different in the way that works in the following expression...

    DB > select regexp_replace ('This is a test', ' (^ [[: alpha:]] +) ([[: alpha:]] {2})', '\2 \1') of double;

    REGEXP_REPLACE

    --------------

    is this a test

    How many times is the model "(^[[:alpha:]]+) ([[: alpha:]] {2})' occur in 'This is a test'?"  Only 1 time.  ' ^' means 'at the beginning of the string", and there is only 1 starting at the chain.  "a you ' does not match the model because" one you "does not occur at the beginning of the string.

  • REGEXP_REPLACE how to loop through the occurrences of a text string variables

    Hello

    I use a 11.g Oracle procedure. I found an example of REGEXP_REPLACE with only two arguments (input and model) and created a procedure based on this example. The Replace function works, but not optimally. I try to use REGEXP_REPLACE to loop on a variable number of occurrences of a text string in a local variable of CLOB.  The string occurs after the text base64 (base64 comma) and before the text "/ > (double quote space oblique superior - only)."  I can do replace it work for a single occurrence, but I can't do it properly in a loop.  These embedded strings include images that were inserted in a rich Apex text field.  This is a rich text field is assigned to the CLOB p_html.

    Declare p_html clob;
      l_image_clob clob;
      l_image_count number;
    Begin
    p_html := '<p>Some header text base64,one start here and then this is the end one" /></p><p>Some header text base64,two start here and then this is the end two" /></p>';
    l_image_count := REGEXP_COUNT(p_html, 'base64', 1, 'i');
    If l_image_count > 0 Then
      For i In 1..l_image_count Loop
      l_image_clob := REGEXP_REPLACE(p_html, '(.*base64,)|(" />.*)');
      dbms_output.put_line(l_image_clob);
      -- code to process each occurrence individually.
      End Loop;
    End If;
    End;

    What I would like to see results of the data are:

    tenure here and that's the end

    two beginning here and that's the end of two

    The results I get are:

    two beginning here and that's the end of two

    two beginning here and that's the end of two

    Thanks a lot for watching this.

    Hello

    From Oracle 11.1, REGEXP_SUBSTR is better than REGEXP_REPLACE for this sort of thing.

    What produces the output you asked for:

    Declare

    CLOB p_html;

    CLOB l_image_clob;

    number of l_image_count;

    Begin

    p_html: = '

    ' Some header text base64, start here and then it's the end "/ >

    Some header text base64, two start here and then it's the end of two"/ >

    ';

    l_image_count: = REGEXP_COUNT (p_html, 'base64', 1, 'i');

    If l_image_count > 0 Then

    For i In 1... l_image_count loop

    l_image_clob: = REGEXP_SUBSTR (p_html )

    , "base64,(.*?)" / > "

    1

    , I - letter i (loop variable), not number 1

    , 'i'

    1

    );

    dbms_output.put_line (l_image_clob);

    -code to treat each case individually.

    End loop;

    End If;

    End;

    /

    The 4th argument to REGEXP_SUBSTR specifies where desired appearance (starting with 1).

    The 6th argument is a backreference. 1 means you want to return all that match the expression starting with the 1st '('. gauche)

  • To delete the characters only at the beginning of a string using regexp_replace

    I want to be able to delete the characters in a string only until the first numeric value.  If it takes place after the digital, I want to keep them.

    "for example"AB1234' becomes '1234', 'AB1234C' becomes ' 1234 C.

    It might be also spaces and other types of characters at the beginning.  I tried this:

    Select

    regexp_replace ('ABC1234', ' [^ [: digit:]]').

    regexp_replace ('AB 1234',' [^ [: digit:]]').

    regexp_replace ('AB 01234',' [^ [: digit:]]').

    regexp_replace ('AB1234C', ' [^ [: digit:]]').

    regexp_replace ('^ 1234', ' [^ [: digit:]]').

    regexp_replace ('* #1234Z ',' [^ [: digit:]]')

    OF THE DOUBLE

    For all except "AB 01234' returned '1234' so it retains the digital.    For "AB 01234' it returns correctly '01234'

    The bad are those with a character after digital, for example "AB1234C".

    I know it I'm missing something here, can someone please help with this?

    Thank you

    SQL> with t
      2  as
      3  (
      4  select 'ABC1234' str from dual
      5  union all
      6  select 'AB 1234' str from dual
      7  union all
      8  select 'AB 01234' str from dual
      9  union all
     10  select 'AB1234C' str from dual
     11  union all
     12  select '^1234' str from dual
     13  union all
     14  select '*#1234Z' str from dual
     15  )
     16  select str
     17       , regexp_replace(str, '^[^[:digit:]]+') str_new
     18    from t;
    
    STR      STR_NEW
    -------- --------
    ABC1234  1234
    AB 1234  1234
    AB 01234 01234
    AB1234C  1234C
    ^1234    1234
    *#1234Z  1234Z
    
    6 rows selected.
    
  • REGEXP_REPLACE question

    DB version 11.2.0.3

    I have a table with the following data:

    CODE

    ABC ({0})

    I need to write a function that returns the following:

    CODE

    ABC (< YEAR CURRENT >)

    where current_year = 2014

    so the output will look like ABC (2014) if the current year = 2014

    Is there an easy way to do it from REGEXP_REPLACE?

    Thank you

    Hello

    Kevin_K wrote:

    ...

    I want to get the result form dynamically

    ABC (2014)

    The solution you posted will help but answers to validate the hard coded value. I just want to replace the '{0}' with 2014

    ...

    Sorry, I don't understand.

    When do you day 'dynamic', you mean that the query will replace '{0}' with ' 2014 "as long as the year is 2014, but from January 1, 2015, the same code will replace with ' 2015"?  Use SYSDATE will take care of that.

    Just hard-code in my previous answer was "ABC (...)", and I thought it was part of your needs.  (Looking at the sample data and results that you have posted, I always still think.)  Why do you have after the INSERT statement for code = 'A2', if you do not have to use it in the expected results, or turn on the other?

    The following query shows 2 ways that both get the results expected from this data set extremely low:

    Select the desc1

    WHEN "ABC ({0}).

    THEN TO_CHAR (SYSDATE

    , ' "ABC ("yyyy").

    )

    OTHERWISE code

    END AS reply_1

    REPLACE (desc1

    , '{0}'

    TO_CHAR (SYSDATE, 'YYYY')

    ) AS reply_3

    of test123

    where code = 'A1 '.

    ;

    Output:

    REPLY_1 REPLY_3

    -------------------- --------------------

    ABC ABC (2014) (2014)

    Of course, you won't have the two columns.  I guess that you definitely don't want reply_1, although I do understand not why (in other words, I understand not your needs).

  • query regexp_replace

    Hi all

    I have a text "AND this and where Leet accumulator or equivalent are the BT end NeAring AND '." I'm using regexp_replace to add {} before and after a few words. It does not work properly. Can someone pleaes point out where I'm going wrong.

    I want the output to be

    "{AND} {and} where Leet accumulator {or} are equivalent {in} {BT} end NeAring {AND}.

    DECLARE
    L_S VARCHAR2 (400);
    BEGIN
    -\s = Word, includes spaces.
    -MARKET!
    L_S: = regexp_replace (srcstr = > ' this and where Leet accumulator or equivalent are the end BT almost AND ',)
    model = > ' (AND\ | \AND| \OR\ | \NEAR\|\NOT\|\MINUS\|\ACCUM\|\ABOUT\|\BT\|\BTG\|\BTI\|\BTP\|\EQUIV\|\FUZZY\|\HASPATH\|\INPATH\|\MDATA\|\NT\|\NTG\|\NTI\|\NTP\|\PT\|\RT\|\SQE\|\SYN\|\TR\|\TRSYN\|\TT\|\WITHIN)',

    ReplaceStr = > "\1 {},"
    position = > 1,
    accident = > 0,
    modifier = > "ix");
    dbms_output.put_line (L_S);

    END;

    Thank you

    Roy

    If you can accept that the result was always a space as a separator, although it has perhaps more in the original version, you can do something like

    DECLARE

    L_S VARCHAR2 (400);

    lv_txt VARCHAR2 (400): = ' T AND or or equivalent are less and within the BT end almost AND ';

    lv_matches sys.odcivarchar2list: = sys.odcivarchar2list('AND','OR','NEAR','NOT','MINUS','ACCUM','ABOUT','BT','BTG','BTI','BTP','EQUIV','FUZZY','HASPATH','INPATH');

    BEGIN

    L_S: = lv_txt;

    L_S: = regexp_replace (l_s, ' + ',' ');

    I'm looping 1.lv_matches.count

    L_S: = regexp_replace (l_s '(^|) ('| lv_matches (i) |') ( |$)', '\1{\2}\3', 1, 0, 'i');

    end loop;

    L_S: = replace (l_s, '',' ');

    Dbms_output.put_line (l_s);

    END;

    {AND} T {or} {or} equivalent {less} {and} in the {} BT end NeAring {AND}

    Correction: placed the first replace out of the loop (feels like Monday morning in fact)

  • Hi all, need help with replacing or Regexp_Replace

    Hi all

    I have a string with me, i.e. '9 03000200090 R R 9 R 9 9 1 9 2 R R 001535447 R 1 R Y R Y 4 1 100002589 1 9 9 9 9 9 9 00002589'

    Now, I would like to remove R-9 characters of my channel, look to the characters below marked "BOLD" - these are those, I want to delete.

    "9 03000200090 R R R 9 9 9 1 9 2 R 001535447 R 1 R Y R Y 4 1 100002589 1 9 9 9 9 9 9 00002589' R '.

    Want my output end: ' 03000200090 1 2 001535447 1 Y Y 4 1 100002589 100002589'.

    Can someone help me please?

    Thank you

    Amit

    Hi, amit,

    Here's one way:

    SELECT REPLACE (REGEXP_REPLACE (REPLACE (str)

    , ' '

    , '  '

    )

    , '(^| ) [R9] ( |$)'

    )

    , '  '

    , ' '

    )

    FROM table_x

    ;

    With a little more coding, your could do it without regular expressions.

  • REGEXP_REPLACE procedure

    Hello

    I have a few unprintable characters (no white space, the work of toppings in the procedure) I want to remove a table for many areas. not a single one.  Can someone help me get this procedure to run to update both fields.  Compiles the procedure but when I run it I get error messages.  The standard update works, but when I add the REGEXP_REPLACE (column_name, ' [^ [: cntrl :]-~]') is where the problem is I think.]])  Thanks for reading.

    [code]

    CREATE TABLE TBL_TEST

    (

    PK_TEST_ID NUMBER (12) NOT NULL,

    VARCHAR2 (30 BYTE) LAST_NAME,

    FIRST NAME VARCHAR2 (30 BYTE)

    )

    CREATE OR REPLACE PROCEDURE p_RegExpChars_TEST)

    pa_table_name all_tab_columns.table_name%TYPE)--,

    -pa_owner all_tab_columns.owner%TYPE)

    IS

    v_sql_text VARCHAR2 (4000);

    BEGIN

    FOR rec

    (SELECT NOM_DE_COLONNE

    From all_tab_columns

    WHERE - owner = SUPERIOR (pa_owner)

    - AND

    table_name = SUPERIOR (pa_table_name)

    AND data_type = 'VARCHAR2')

    LOOP

    v_sql_text: =.

    "UPDATE".

    --|| pa_owner

    --|| '.'

    || pa_table_name

    || 'SET '.

    || recomm. COLUMN_NAME

    || ' = REPLACE (")

    || recomm. COLUMN_NAME

    || ' [^ [: cntrl:]-~]'

    || ')';

    EXECUTE IMMEDIATE (v_sql_text);

    COMMIT;

    END LOOP;

    END p_RegExpChars_TEST;

    /

    -When I run, I get error messages.

    execute p_RegExpChars_TEST ('TBL_TEST');

    -Error messages

    ORA-00907: lack of right parenthesis

    ORA-06512: at "P_REGEXPCHARS_TEST", line 28

    ORA-06512: at line 1

    -Test data

    Of INSERT INTO TBL_TEST values (20040968, 'HARRIS', 'JOHN');

    Of INSERT INTO TBL_TEST values (20040969, 'PAYNE', 'DIANNA');

    Of INSERT INTO TBL_TEST values (20040970, 'CARTER', 'DARLENE');

    Values inserted INTO TBL_TEST ("20040971, ' JARVIS","MICHELLE");

    Of INSERT INTO TBL_TEST values (20040972, 'HAYES', 'SAMANTHA');

    -It works but I want to perform the procedure for each column in the table which is VARCHAR2

    -do not change the names of fields and run every time.

    UPDATE TBL_TEST

    SET last_name = REGEXP_REPLACE (LAST_NAME, ' [^ [: cntrl :]-~]')]])

    WHERE REGEXP_LIKE (LAST_NAME, ' [^ [: cntrl :]-~]')]])

    [/ code]

    Just add DBMS_OUTPUT. Put_line (v_sql_text); before EXECUTE IMMEDIATE and you will see what SQL statement is. And there is no need to update a column at a time:

    CREATE OR REPLACE

    PROCEDURE p_RegExpChars_TEST)

    pa_table_name all_tab_columns.table_name%TYPE,

    pa_owner all_tab_columns.owner%TYPE

    )

    IS

    v_sql_text VARCHAR2 (4000);

    BEGIN

    v_sql_text: = "UPDATE". pa_owner | '.' || pa_table_name | "TOGETHER";

    FOR (IN) rec

    SELECT column_name

    From all_tab_columns

    Owner WHERE = UPPER (pa_owner)

    AND table_name = UPPER (pa_table_name)

    AND data_type = "VARCHAR2".

    ) LOOP

    v_sql_text: = v_sql_text | recomm. COLUMN_NAME |

    ' = REPLACE ("|") Rec. COLUMN_NAME | ',''[^[:cntrl:] -~]''),';

    END LOOP;

    DBMS_OUTPUT. Put_line (RTrim (v_sql_text, ','));

    RUN IMMEDIATELY RTRIM (v_sql_text, ',');

    END p_RegExpChars_TEST;

    /

    Created procedure.

    SQL > set serveroutput on
    SQL > exec p_RegExpChars_TEST ('tbl_test', 'scott');
    UPDATE scott.tbl_test SET LAST_NAME = REPLACE (LAST_NAME,'[^ [: cntrl:]-~]'), name = REPLACE (FIRST_NAME,'[^ [: cntrl :]-~]')]])

    PL/SQL procedure successfully completed.

    SQL >

    SY.

Maybe you are looking for