Grouping and backreferences with regular expressions on the window to replace the text

I'm really appreciate the inclusion of regular Expressions in the search and replace functionality. One thing miss me that East of backreferences in the replacement expression. For example, in unix tools vi or sed, I could do something like this:
 s/\(firstPart\) \(secondPart\) \(oldThirdPart\)/\2 \1 newThirdPart/g 
that allow me to switch the places of first and secondPart and substitute totally thirdPart. If grouping and backreferences are already present in the window replace text, how do you properly call them?

Published by: Justin.Warwick on August 23, 2011 08:26

You can vote on the request for this to the exchange of SQL Developer, to add weight to the implementation as soon as possible: https://apex.oracle.com/pls/apex/f?p=43135:7:3693861354483465:NO:RP, 7:P7_ID:16761

Kind regards
K.

Tags: Database

Similar Questions

  • HELP WITH REGULAR EXPRESSIONS

    Hello
    I'm just experimenting with regular expressions

    My information in table are as shown below
    TABLE NAME: -  EMP_TEST
    
    STRUCTURE WITH DATA
    
      X_NAME
    ---------------------
    12456com
    ab1245com
    AXM4554.com
    Now, I pulled the following query to find the rows that have 1
    select *
    from emp_test
    where regexp_like (x_name,'[1]')
    
    RESULT AS EXPECTED : -
    
    
      X_NAME
    ---------------------
    12456com
    ab1245com
    Now, I want to do a query that will give me tose lines that do not have 1

    Initially I have run the following query
    select *
    from emp_test
    where regexp_like (x_name,'[^1]')
    
    RESULT NOT AS EXPECTED : -
    
      X_NAME
    ---------------------
    12456com
    ab1245com
    AXM4554.com
    After a bit of searching on Google I found an application that works as expectd
    select *
    from emp_test
    where regexp_like (x_name,'^[^1]*$')
    
    RESULT AS EXPECTED : -
    
      X_NAME
    ---------------------
    AXM4554.com
    Where my basic question is that all seeking a 1 in a row we do not put the beginning ^ end $ and so on and the
    Works of query.
    So why do [^ 1] does not work as shown, while excluding an amd why is ^ [^ 1] * $ necessary while excluding a

    Hello

    Elessar wrote:
    So why do [^ 1] does not work as described

    Because regexp_like(str,'[^1]') means: search str who have at least one character that is not 1.
    When regexp_like(str,'^[^1]*$') means: search str done characters that are not 1 start (^) at the end ($)

  • Need help with regular expressions

    Hi all

    I need your help, because I have no ideas more...

    I have the following problem: in the column of the database table, I have the string with the names of files already uploaded to the database. For example: + File1_V01.txt +, + File1_v02.txt +, + File1_01_v01.txt +, etc. The string _vxx * + or _Vxx * + (non-case sensitive) represents the version of the file.

    Now the problem: I'll upload the file with the name + File1_v02.txt + (already exists in the table).
    If the file name already exists in the table the pl/sql function should get the name of the file with the following version number. In my case it takes + File1_v03.txt +.

    Is it possible to do this using SELECT with regular expressions?

    Best regards and thanks!
    with t as (
      select 'File_V05.txt' fn from dual union all
      select 'File_V04.txt' fn from dual union all
      select 'File2_v03.doc' fn from dual union all
      select 'File2_v115.doc' fn from dual union all
      select 'File2_v15.doc' fn from dual union all
      select 'File1_v03.doc' fn from dual union all
      select 'File1_v115.doc' fn from dual union all
      select 'File1_v999.doc' fn from dual union all
      select 'File2.doc' fn from dual union all
      select 'File2_v05.doc' fn from dual union all
      select 'File1_v01.txt' fn from dual union all
      select 'File1_v02.txt' fn from dual union all
      select 'File1_v1.txt' fn from dual union all
      select 'File1_v1.doc' fn from dual union all
      select 'File1_v2.txt' fn from dual union all
      select 'File2_v01.doc' fn from dual union all
      select 'File2_v02.doc' fn from dual union all
      select 'File1_ABC_v01_DEF.docx' fn from dual union all
      select 'File1_ABC_V02_ABC.docx' fn from dual union all
      select 'File1_ABC_v01_12_04_17.docx' fn from dual union all
      select 'ABC_V1_QWERT.pdf' fn from dual
    )
    
    select fn,
    case when fn!=fn_new then
     last_value(fn_new)
     over(partition by regexp_replace(upper(fn),'V[[:digit:]]+','') --(.*?V0*)([1-9]+)(\..*?)$
     order by nv
     rows between unbounded preceding and unbounded following
     )
    else fn
    end fn_new
    from (
        select
        case when v-1 <= 0 then fn
        else
               regexp_replace (fn,
                        '(_v|_V)(\d*)',
                        case
                        when length(substr(fn,v+1,p-v-1)+1) > (p-v-1)
                        then '\1'||to_char(substr(fn,v+1,p-v-1)+1)
                        else '\1'||lpad(substr(fn,v+1,p-v-1)+1,p- v-1,0)
                        end
               )
        end fn_new
        ,fn
        ,case when v-1 <= 0 then -1
         else
            substr(fn,v+1,p- v-1)+1
         end nv
        from (
            select fn, regexp_instr(upper(fn),'_V[[:digit:]]+',1,1,1) p, instr(upper(fn),'_V')+1 v from t
        )
    )
    order by fn
    
    FN     FN_NEW
    ABC_V1_QWERT.pdf     ABC_V2_QWERT.pdf
    File_V04.txt     File_V06.txt
    File_V05.txt     File_V06.txt
    File1_ABC_v01_DEF.docx     File1_ABC_v02_DEF.docx
    File1_ABC_v01_12_04_17.docx     File1_ABC_v02_12_04_17.docx
    File1_ABC_V02_ABC.docx     File1_ABC_V03_ABC.docx
    File1_v01.txt     File1_v3.txt
    File1_v02.txt     File1_v3.txt
    File1_v03.doc     File1_v1000.doc
    File1_v1.doc     File1_v1000.doc
    File1_v1.txt     File1_v3.txt
    File1_v115.doc     File1_v1000.doc
    File1_v2.txt     File1_v3.txt
    File1_v999.doc     File1_v1000.doc
    File2.doc     File2.doc
    File2_v01.doc     File2_v116.doc
    File2_v02.doc     File2_v116.doc
    File2_v03.doc     File2_v116.doc
    File2_v05.doc     File2_v116.doc
    File2_v115.doc     File2_v116.doc
    File2_v15.doc     File2_v116.doc
    
  • Regular expressions in the field of Validation does not.

    I really hope someone can help me.  I'm quite familiar with regular expressions, but for some reason, I can't it to work.

    Environment: Windows XP

    Adobe Acrobat version 8.12

    Scenario:

    In a text field of the form, the user enters a full path.

    This is the code that runs when the user leaves the field:

    / * Test alternatives

    var validChars = / ^ \w [:\\]$/
    var validChars = / ^ \w :\\$/

    var validChars = / ^ [A - Z] [a - z] [0-9] [:\\_]$/

    */


    var validChars = / ^ [A-Za-z0-9 :\\_]$/

    If (event.value! = "")
    {
    If ((event.value) validChars.test is false)
    {
    App.Alert ("Invalid character.  Only alphanumeric, colon, underscore, backslask and spaces are valid characters. ») ;
    Event.RC = false;
    }
    }

    The characters allowed in the path are: alphanumeric, underscore, colon, backslash (\), and space.

    I tried all the expressions above with c:\aoa_apps and they all fail: alert the invalid character appears.

    I've added alerts to print the event.value and that seems to be ok.

    I tried all of them with c:aoa_apps and they still fail.  Finally, I tried caoa_apps and they still aren't.

    I checked each of the expressions in a small validator of expression that I have and they seem to be ok.

    I'm cross-eyed looking for a reason why it's a failure.   So, apparently, that I do something stupid, again, I'm new to scripting Adobe Acrobat.  But for the life of me, I can't.

    Can anyone spot the problem?

    Any help is greatly appreciated.

    caerial.

    How you set up your regexp, only the first character is tested. Try

    place a * before the $.

  • Mask a number with regular expressions

    Hi @ll!

    Is it possible to hide a given number

    of "12345678" in "XXXX5678".
    or '987458' to 'XX7458 '.

    with Regular Expressions and without substr()? To display only the last four digits and the 'X' value for the rest. The size of the number is not always the same.

    Alex, I think the OP wanted the first 4 characters to hide ;)

    Something like that?

    select translate(substr('12345678',1,length('12345678')-4),'1234567890','XXXXXXXXXX')
                    || substr('12345678',length('12345678')-3)
              from dual
    /
    TRANSLAT
    --------
    XXXX5678
    

    More

    with test_data as
    (
    select '12345678' card_no from dual
    union all select '123456' from dual
    union all select '5678900' from dual
    ) -- End of test data
    select translate(substr(card_no,1,length(card_no)-4),'1234567890','XXXXXXXXXX') ||
              substr(card_no,length(card_no)-3)
        from test_data
    /
    
    TRANSLATE(SUBSTR
    ----------------
    XXXX5678
    XX3456
    XXX8900
    

    Arun-

  • How to create user defined groups and users with custom permissions as only open and export in obiee 11 g?

    Hello

    I want to give as open & export to the level of permissions.

    How to create user defined groups and users with custom permissions as only open and export in obiee 11 g?

    For example, if the group permissions, inturn should reflect on the users.

    Please help me.

    Thanks in advance,

    A.Kavya.

    Your question is quite broad and fuzzy then I suggest the security catalog presentation to read documentation: http://docs.oracle.com/middleware/1221/biee/BIESC/mgrgrpsusers.htm#CIHIBJGD

    And I think that you mix you two things which are managed in different places:

    ) an object as read access permissions, write, delete... which control you through the object "Permissions" dialog box

    (b) functional privileges controlled through "Manage privileges" under "Administration".

  • Need help with regular Expression (RegEx)

    Try to wrap your head around a regular Expression for the following format example: 0022-C-4452 OR 0022-C-4452-C


    * The 4 digits are always numbers

    * The last 5 digits are alpha numeric

    * Last (if used) digit is always 'C' (in reference to the second structure)

    Hold the dashes for "auto fill" if possible? This would be in the Custom Format? Sequence of keys? Or Validation? I appreciate any help!

    I still think that you did not correctly describe your problem.

    1 figures of 4 characters.

    Optional separator.

    Then 6 alphanumeric characters and ' - '.

    OR

    1 figures of 4 characters.

    Optional separator.

    Then 6 alphanumeric characters and ' - '.

    Optional separator.

    Character 'C '.

    Note that the "-" is not a number and not an alphabetic character. It is a white space character.

    Try:

    function {MyRe (cString)
    var cFormatted = "";
    var RE_MyCode0 = /^(\d{4})[-.]) {0,1} ([A-Za-a0 - 9-] {6}) $/;
    var RE_MyCode1 = /^(\d{4})[-.]) {0,1} ([A-Za-a0 - 9-] {6}) [-.] {0,1} ([C]) $/;
    If (RE_MyCode0.test (CString) == true) {}
    cFormatted = RegExp. $1 + '-' + RegExp. $2;
    }
    If (RE_MyCode1.test (CString) == true) {}
    cFormatted = RegExp. $1 + '-' + RegExp. $2 + '-' + RegExp. $3;
    }
    Return cFormatted;
    } / / end of MyRe function;

    some tests;
    var MyString = "0022-C-4452; good channel;
    Console.println ("Input:" + MyString);
    Console.println ("result:" + MyRe (MyString));

    var MyString = "0022-C-4452-C; string of Goo;
    Console.println ("Input:" + MyString);
    Console.println ("result:" + MyRe (MyString));

    var MyString = "A022-C-4452" / / bad string;
    Console.println ("Input:" + MyString);
    Console.println ("result:" + MyRe (MyString));

    var MyString = '0022-4452-CZ' / / bad string;
    Console.println ("Input:" + MyString);
    Console.println ("result:" + MyRe (MyString));

  • Regular expression for the format: 000-000 - 000000 000000

    Hi guys,.

    I need to validate the columns in a regular expression for the format of 000 000 - 000000 000000.

    For example - if the column contains a value such as "500 110 - 500044 000100" then it should return 'true' otherwise 'false. '

    Your timely help is well appreciated.

    Thanks in advance.

    Hello

    inDiscover wrote:

    Hi guys,.

    I need to validate the columns in a regular expression for the format of 000 000 - 000000 000000.

    For example - if the column contains a value such as "500 110 - 500044 000100" then it should return 'true' otherwise 'false. '

    Your timely help is well appreciated.

    Thanks in advance.

    If you want a regular expression

    REGEXP_LIKE (str

    {{' ^ {\d{3} \d{3}-\d{6} \d{6}$'

    )

    According to your needs.

    You don't need regular expressions for this.  It will be more efficient to use

    TRANSLATE (str

    '012345678'

    '999999999'

    ) = 999 999 - 999999 999999'

  • Acrobat Reader DC will not install. It goes about 85% and stops with a message that the file I am trying to achieve is on a network and not available.  Totally frustrated that many files need this program to open.

    Acrobat Reader DC will not install. It goes about 85% and stops with a message that the file I am trying to achieve is on a network and not available.  Totally frustrated that many files need this program to open.

    I got this program for years.  Update Windows 10 and after nothing more than headaches with he returned to Windows 7 and it is then Acrobat has stopped working.

    Hi lindat7439924,

    There is no uninstall for Mac Reader program. You can directly delete the application from the Applications folder, which is just trash/Applications/Adobe Reader.app.

    Then you can download Adobe reader from here: http://get.adobe.com/reader/enterprise/

    Kind regards

    Meenakshi

  • I need to find all of the XML elements and add a line break for the text of each of them

    I need to find all XML elements and to add a line break the text of each of them.

    Is it possible with a script?

    Try this piece of code as it is. I hope that's what you want...

    var myDoc = app.activeDocument;
    var inddRooElement = myDoc.xmlElements.item(0);
    var xPathElements = inddRooElement.evaluateXPathExpression("//*");
    var elementCount = xPathElements.length;
    for(var eId=0; eId
    

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

    Green4ever

  • My errased sticker product key and I can't read all the text to reactivate my windows visa. What should I do now?

    My errased sticker product key and I can't read all the text to reactivate my windows visa. What should I do now?

    Hello

    You mean the sticker on the case of the Vista operating system pre-installed from Dell, HP, Acer, Toshiba, etc.) ?

    If you do, you can contact your computer manufacturer and ask them to send you a set of recovery disks.

    They should do this for a small fee.

    To reinstall Vista using their recovery disk/s, you start from the 1st recovery disk they provide and follow the manufacturer's instructions to reinstall:

    You need to change the Boot order to make the DVD/CD drive 1st in the boot order:

    How to change the Boot order in BIOS:

    http://pcsupport.about.com/od/fixtheproblem/SS/bootorderchange.htm

    "How to replace Microsoft software or hardware, order service packs and replace product manuals.

    http://support.Microsoft.com/kb/326246

    And if you have never received a recovery disk when you bought your computer, there should be a recovery Partition on the hard drive to reinstall Vista on how you purchased your computer.

    The recovery process can be started by pressing a particular combination of the key or keys at startup. (Power on / start)

    Maybe it's F10, F11, Alt + F10, etc., depending on the manufacturer.

    Ask them to the proper key sequence.

    And if you do not score a manufacturer of recovery on your hard drive, you should be able to make your own recovery from her disks to reinstall the operating system.

    Go to programs > name of the manufacturer of your computer > then their system or recovery tools software topics for them, depending on how it is formulated.

    If you can't find any reference to it, contact the manufacturer for advice on how to make these recovery disks.

    The methods above resettlement generally do not require allows you to provide a product key during Installation, the recovery process uses the Installation product key factory to activate automatically during the resettlement process.

    See you soon.

  • How can I the date and time using regular expressions

    Hi all

    I have depolyed filtering the log agent. While setting properties, I would like to recover the file that is generated at the present time, but along the way, I am unable to define, what regular expression that I provide retireves date and time specific file...

    Leave with kindness, men know is it possible to do?

    Thanks in advance.

    Shiva

    This seems to be the same question I can't add a timestamp in logfilter, so I'll answer in this thread. Please check the two wires as "Answered" when the issue has been resolved.

    Kind regards

    Brian Wheeldon

  • Why the books are grouped and preinstalled with the operating system?

    It's complaints

    My Portege has Windwosw Vista. I didn't want to buy Vista, but they were only selling with him and no other choice was possible to purchase.

    First of all, my laptop had problems to install Windows updates. I could not connect my institution's Internet System. I had to reinstall the system again.
    It's a waste of time!

    After re-installation of the button for the sound on the outside Panel does not work correctly.

    Also, when I try to stop the laptop sometimes it restarts itself - he doesn't stop!

    Secondly, I had a problem with the laptop, when an opportunity to visit a well-known site, it serves to block itself.
    Once, when he is blocked, I had to restart and its screen remained black. They took for repair. It was delivered later - repaired, but with a defect on the screen!
    What a... workers!

    When I bought this laptop he had an offer with the update of Vista with Windows 7 after their release.
    Wonderful. But just note, Toshiba has the highest price of the offer, compared to its competitors - 30 (or £) against 15 for others, which of course I'm not going to pay.

    I already paid for Vista, which is incredible, and I knew, but I had not choice not to buy!

    All right, so there is still competition in the market, several possibilities are present - install Windows cracked, switch to Linux or just buy an Apple!

    Please, take this comment seriously! And please, stop with group buying, no matter what the benefit is. It won't work for long.

    Hi mate

    Fact is that most of the laptop manufacturers sell the computer and laptop computer with a preinstalled operating system. So I wouldn't blame Toshiba or other brands for which

    You get a new computer/laptop with a new OS.
    During the past 20 years, Microsoft released 3.0 Win, Win 95, Win 98, Win NT, W2k, Win XP, Win ME, Vista and Win 7, I remember that all my computers or laptops were grouped with these operating systems

    Toshiba offers the notebook with a clean image and you can also create a recovery disk (so don t need to buy anything if you need t n)
    Of course, each of us can install a clean OS, but there are a lot of people who are happy with such image pre-installed because everything is pre-installed and configured.

    Many people have no knowledge of computer wide and are really recognizing that everything is pre-installed and the configuration does not have a lot of time

    With regard to the question of the laptop;
    What to say; you had a bad luck that something was wrong with the laptop. This can still happen that my new LCD TV other manufacturer, was dead after two weeks, I called ASP, then replaced the screen now is ok

  • regular expression for the xml tags

    Dear smart people of the labview world.

    I have a question about how to match the names of xml text elements.

    The image that I have some xml, for example:

    Peter

    13

    and I want to match all of the names of elements, that is to say: no, son, grandson, age, regardless of any attribute have these items. There is a regular expression, I can loop, that can do this? (Something like "\<.+\> ". "") It is no good because it matches the entire xml string.) I'd really only two different expressions, one for the match start elements, e.g. and one for the correspondence of the elements, for example.

    Thanks for your help in advance!

    Paul.

    The site Of regular Expressions will be very convenient.

    They have some good tutorials on regexp with a demo of the XML tags:

    Here is a small excerpt:

    The regular expression <\i\c*\s*>matches an opening of the XML without the attributes tag corresponds to a closing tag. <\i\c*(\s+\i\c*\s*=\s*("[^"]*"|'[^']*'))*\s*>corresponds to an opening with a number any attributes. Put all together, <(\i\c*(\s+\i\c*\s*=\s*("[^"]*"|'[^']*'))*| i\c*)\s*="">corresponds to an opening with attributes or a closing tag.  (source)

    If you want advanced XML analysis I suggest JKI XML toolkit.

    Tone

  • Oracle regular expressions - splits the string into words for

    Hello

    Nice day!

    My requirement is to split the string into words.

    So I need to identify the new line character and the semicolon (;), comma and space like terminator for string entry.

    Please note that I am currently embedded blank and the comma as separator, as shown below.

    Select regexp_substr('test)
    TO
    string in words, "([^, [: blanc:]] +) (', 1, 1) double;"

    How to integrate the semicolons and line break characters in regular expression Oracle?

    Please notify.

    Thanks and greetings

    Sree

    This has nothing to do with REGEXP. Is SQL * more parser does not not a semicolon at the end of the line:

    SQL > select ' testto, mm\;
    ERROR:
    ORA-01756: city not properly finished chain

    SQL >

    Just break the chain:

    SQL > select regexp_substr ('testto, mm\;' |) '
    2 string into words
    3 \w+',1,level ',') of double
    4. connect by level<= regexp_count('testto,mm\;'="" ||="">
    5 string in words
    6      ','\w+')
    7.

    REGEXP_SUBSTR ('TESTTO, MM\;' |') STRINGIN
    --------------------------------------
    Testto
    mm
    string
    in
    Words

    SQL >

    Or modify SQL * more the character of endpoints:

    SQL > set sqlterm.
    SQL > select regexp_substr ('testto, mm\;)
    2 string into words
    3 \w+',1,level ',') of double
    4. connect by level<=>
    5 string in words
    6      ','\w+')
    7.

    REGEXP_SUBSTR ('TESTTO, MM\;) STRINGINTOWO
    --------------------------------------
    Testto
    mm
    string
    in
    Words

    SQL >

    SY.

Maybe you are looking for