How REGEXP_REPLACE used to replace the part of the string?

Hello

How can I replace the portion of string as follows, I want to replace the space as by ' - '.

SELECT
REGEXP_REPLACE (superior ("' Laura bought stuff from 2000 USD on 12 September 2012 to KL and kl left on September 20, 2012"),)
' [0-9] {1,2} [^ 0-9](JAN|) FEB | MAR | APR | JUN | JUL | AUG | MS | OCT | NOV | DEC) [^ 0-9] [0-9] {4}',
(','-') "REGEXP_REPLACE.
FROM DUAL;

the output will be like this

Laura bought of the stuff of 2000 USD on 12-Sep-2012 of KL and kl left on 20-Sep-2012

concerning

Something like that?

SELECT
REGEXP_REPLACE('Daivd bought stuff by 2000 USD on 12 Sep 2012 from KL and left kl on 20 Sep 2012',
'([0-9]{1,2}) (JAN|FEB|MAR|APR|JUN|JUL|AUG|SEP|OCT|NOV|DEC) ([0-9]{4})',
'\1-\2-\3',1,0,'i') "REGEXP_REPLACE"
FROM DUAL;

Explanation:

You group the parts of the date de-construct with (additional).
You can use expressions, backreference \1 \2 \3 and add '-' between \1-\2-\3 signs.

You should not user upper ('...') in the first parameter. If you cannot recover the original state of the letters.
If you want to case-insensitive matching you should use 'I' in the last parameter of regexp_replace.

http://docs.Oracle.com/CD/B19306_01/server.102/b14200/functions130.htm

Published by: hm on 25.09.2012 00:38

Tags: Database

Similar Questions

  • Satellite A30 921: how to remove and replace the memory?

    Hi, can someone help me how to remove and replace the memory of satellite A30 921. and also, please give a detailed instruction.

    Thank you in advance.

    Hello

    There is not much to explain. On the low side in the Middle it is placed to cover memory (fixed with two screws). Remove the cover and you will see 2 slots there. I put t know how much memory you here but like Stefan says you can use max 2 GB of RAM (2 x 1024Mo PC2700 - PA3313U-1M1G). How to remove the memory modules, which you can see on http://www.hardwaresecrets.com/article/189/5

    Good bye

  • Is it possible (or useful) to replace the processor in my HP Pavilion Elite m9060n...

    Is it possible (or useful) to replace the processor in my media library of Rikouman Pavilion Elite m9060n PC... There an IPIBL-(Berkeley) motherboard with Intel Chipset G33. Intel Core 2 Quad Logo running up to 2.4 GHz. is there a processor more fast which will be taken in the Socket 775 and improve the operating speed? It is economically interesting if possible? Would be very happy comments from some computer guru, as I'm obviously a novice.

    Morrismomic, welcome to the forum.

    The existing processor is Quad core maximum that you can use.  Your only choice is the Core 2 Duo E6700 or E6850:

    http://support.HP.com/us-en/document/c01197633

    Personally, I'm not sure you'll see an appreciable performance gain with either.  The memory and the video card are major concerns, too.  The system is as strong as its weakest component.

    If your problem is solved, please click "accept as a Solution.

  • Laptop HP Touchsmart 15-D020: how to remove and replace the keyboard on laptop HP Touchsmart 15-D020NR

    I spilt a drink on my keyboard and now I can not turn off the caps lock and a number of keys does not work. I need instructions on how to remove and replace the keyboard frame. Thank you.

    On your page of support-look for Maintenance and Service of Guide in the manuals.

    http://support.HP.com/us-en/product/HP-15-D000-TouchSmart-notebook-PC-series/6627588/model/6761859/manuals

  • How to replace the string "\" on json webservice?

    Hello

    I have problem with this json

    "{\"search_result\":[{\"name\":\"Mall Summarecon\",\"category\":\"BusinessEntity\",\"id\":\"1\"},{\"name\":\"Bamboo Dim Sum\",\"category\":\"BusinessEntity\",\"id\":\"2\"},{\"name\":\"Dimsum Ceker\",\"category\":\"Item\",\"id\":\"1\"}]}"
    

    I want to replace the string "\".

    the json are already working on my app via .cpp file

    I already add json.replace on my qml

    function simpleSearch(response){
            indicator.stop()
            model.clear()
            console.log("Response: "+response)
            var json = JSON.parse(response)
            json = json.replace('\\', ' ') // this is how the way i replace
            if (json == "[]")
                notFound.visible = true
    
            else
                model.append(json.search_result)
        }
    

    but still does not work

    is there a different way to replace it?

    Thank you

    Change your simpleSearchFinished as follows

    ....simpleSearchFinished()
    {
        QNetworkReply *reply = qobject_cast(sender());
        if (!reply->error()){
            QByteArray response = reply->readAll();
            response.replace("\\", "");
            if (response.startsWith("\"")){
                response.remove(0, 1);
            }
            if (response.endsWith("\"")){
                response.remove(response.length()-1, 1);
            }
            emit simpleSearchDone(response);
        }else{
            const int httpCode = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
            qDebug() << "ErrorCode" << httpCode << endl << \
                    "ErrorString" << reply->errorString();
            emit error(httpCode, reply->errorString());
        }
        reply->deleteLater();
        manager->deleteLater();
    }
    

    and QML

    function simpleSearch(response){
        indicator.stop()
        model.clear()
        var json = JSON.parse(response)
        if (json){ // is VALID/PARSED
            model.append(json.search_result)
        }
    }
    

    As I wrote, it is not a good workaround solution. The best is to send VALID JSON string directly from your server. But it works

  • How to use paper in the latest version of Windows Live Mail?

    How to use paper in the latest version of Windows Live Mail?

    Version 2011

    Short answer: the stationery support has been removed from Windows Live Mail with the upgrade of v.2009 v.2011 back in 2010.

    Long answer: there are two solutions of workaround that you can try.

    • If you have a stationery .htm file, open it in Internet Explorer, and then select file > Send > Page by email (Alt - F E P). Save the message as a result as a .eml file and use it as a model for messages.
    • You can get in shape, for example a background color, to a HTML signature, then apply this signature to an e-mail message. Here's the one I use when sending pictures:


      Hello!

      Love
      Noel


      Here is the result:

  • JavaFX how to use WebView load the local HTML page?

    JavaFX how to use WebView load the local HTML page?

    If the HTML code of the files in the class path, which is in the package, the load using one of the following ways:

    String url = Main.class.getResource("/html/index.html").toExternalForm();
    engine.load(url);
    

    The above methods can only load files outside the class path!

  • How to use PS to judge the existence of a file in the directory specified and how to use PS to the directory specified for create to create the file? (javascript)

    1, how to use PS to judge of the existence of a file in the specified directory? (using javascript)

    2, how to use PS to the directory specified for create to create the folder? (using javascript)


    Thank you!

    If (Folder(/*_insert_the_path_here_*/).exists == false) {Folder(/*_insert_the_path_here_*/).create()}

  • How to use photoshop with the same account on more than one laptop?

    How to use photoshop with the same account on more than one laptop?

    a single user license entitles you to two facilities simultaneous/activations.  so, what's the problem?

  • Replace the string value of table

    with cte as)

    Select val '123', 'abwec' double val1

    Union of all the

    Select "456" val, "mowerw" double val1

    Union of all the

    Select val '709', 'wkwere' double val1

    Union of all the

    Select val '078', 'awerwewerwreq' double val1

    )

    Select * from cte;

    -incoming string

    "asdasd123ewrwer@87w8eopiu456werwer@asdwer709@ewrwerewrwqqwezxder078 @..."

    need to replace like 'abwec' 123 and 456 as "mowerw" and 709 as wkwere and 078 as 'awerwewerwreq '.

    How to replace the string value of the string

    I'm going to the table which will have mapping information I need to see the incoming string and replace the appropriate value of the val to val1

    something like

    Of

    "asdasd123456werwer@asdwer709@ewrwerewrwqqwezxder078ewrwer@87w8eopiu @..."

    TO

    "asdasdabwecewrwer@87w8eopiumowerwwerwer@asdwerwkwere@ewrwerewrwqqwezxderawerwewerwreq@..."

    By using the TYPE clause.

    with cte as

    (

    Select val '123', 'abwec' double val1

    Union of all the

    Select "456" val, "mowerw" double val1

    Union of all the

    Select val '709', 'wkwere' double val1

    Union of all the

    Select val '078', 'awerwewerwreq' double val1

    ),

    input_tbl

    as

    (

    Select "asdasd123ewrwer@87w8eopiu456werwer@asdwer709@ewrwerewrwqqwezxder078 @..." input_str

    of the double

    )

    Select max (input_str) Dungeon (first order by desc NWR dense_rank) input_str

    de)

    Select rno, input_str

    de)

    Select rownum NWR

    val

    val1

    input_str

    count (*) over() cnt

    from cte

    Cross

    Join input_tbl

    )

    model

    dimension (NWR)

    measures (val, val1, cnt, CAST (input_str AS VARCHAR2 (4000)) input_str)

    (

    input_str [any] = replace (nvl (input_str [cv () - 1], input_str [cv ()]), val [cv ()], val1 [cv ()])

    )

    )

  • Search and replace the string formatting

    Hello

    I try to do a search and replace the formatting of a string.

    In the example, I'm looking for the string 'SUCCESSFUL', but it must also begin by usbflash and some number + PASSED.

    I can't get the format to have a number between 1 and 99. The number of replacements should add up to 6 in this case. I tried with \d for any number, and I also tried [1-99].

    Make a right-click on the function search and replace the string.  There is an option to use regular Expressions.  Then give it a try.

    EDIT: You need to set the entry replace all to TRUE.

  • HP 700-330qe: how to disable or replace the SSD on HP 700-330qe

    Help for my HP 5 months! It kills Me!

    I bought a HP 700-330qe in 2014 from Amazon and just started getting SMART of Windows hard disk errors whenever my computer restarts, telling me that the hard drive failure is imminent. He also tells me to shut down the computer immediately, save it, contact the manufacturer, etc. Never seen it in any PC I owned before. Naturally, I freaked out and did some internet research, discover that it is relatively easy to clone and replace a hard drive. I ordered a new hard drive Western Digital 3 TB of Amazon, a docking station for disc brand cable hard of Amazonia and downloaded the Macrium Reflect free disk management software.

    Items from Amazon arrived in a few days and I got to work making a clone of my one and only hard drive. Clone was made with little problem. Shut down the computer, it opens and replaced the old hard disk with a new one. Start the computer to the top and got the same message on imminent hard drive failure! So I paid more attention to it this time and looked up the model number in the warning message, which was: ScanDisk SDSA6DM - 016 G-1006. I Googled that and found it was the disk solid state drive (SSD) used as a cache to speed up certain operations. Arrgh.

    I stuck my old hard drive in the hard drive docking station and was ready to be cloned partition SSD and all partitions on the hard drive to the hard drive and the removal or at least unplug the SSD drive to get rid of this problem. The software told me that the SSD is shaped as MPR (or something like that) while the main hard drive is formatted as GPT, which are different types of hard drive, formatting, so you cannot copy these different types of partitions on a hard drive.

    So here's my options as I see them:

    (1) I have to either disable the SSD, but I don't know how and I don't know if the computer will always start the same. Windows is partially installed on SSD? I do not know.

    (2) to clone and replace the DSS about the same way I did with the main hard drive. I can get the SSD according to Amazon for $49: Kingston Digital 60 GB SSDNow V300 SATA 3 2.5 (height of 7mm) with adapter Solid State Drive SV300S37A / 60G.

    For the option #2 above, the only problem is that I have no idea where the OEM SSD of ScanDisk is currently installed in my computer! It is in the hard drive cage? I don't see anything else installed there. I thought it was in the cage directly above the hard drive cage, but I think that what I was looking at was the front memory card reader/USB ports. I don't have on CD Player installed and I can see where it is. Help!

    PS: I also downloaded EaseUS Partition Master 10.2 and it allows to analyze the SSD drive. While it was scanning it found 9 bad blocks (on tens of thousands of blocks), but when he finished the analysis it says there is a lot of blocks. For this to happen on an SSD, which is supposed to be more reliable than hard disks of small, to make this so much more aggravating situation. At least, I upgraded my hard drive 2 TB to 3 TB and know now that I can do. Sigh.

    Yes, I had a frusrtrating very experience with HP customer support, even after it was raised to a case manager based in the United States, who called me home. She found no part at all in its computer system and wanted to send me in my whole PC to a service center customer (it was still under warranty) which would take at least 3 weeks. I said no and went forward and the DSS out of my computer. I stopped receiveing the error messages and did not notice a slow down in performance, but went ahead and bought and installed this one, just in case it actually provides an advantage: My Digital 32 GB SSD Bullet Proof (on Amazon for $25).

    As a note to end funny to this drama, about 6 months after my discussion with HP support I describe above, I have randomly mailed an envelope of HP with the exact 16 GB SSD, they said that they didn't in their system. It also included an envelope to return my faulty SSD and a stern note saying if they do not receive the defective item within 3 days my credit card (that I never gave them) would be charged. I threw a long time ago the defective item and just throw it back into a drawer... or maybe that I returned it in the envelope for return of defective product? I don't remember really.

    In any case, it was a horrible customer service experience, and since then I have another HP Envy (my PC 3 year to my son) have a hard drive and video card fail at the same time. I replaced the two after a few problems, but no matter what I do, it can get its setup dual monitor want to work more. I tried several video cards and nothing.

    All of these factors combined caused me write off HP for the future PC purchases. The guys in my company IT say it's the reason why we only buy Dell computers at work (we have hundreds of maintain). They do not use strange pieces like these small SSD cache records, and their parts are standard and easy to replace because of the case. I'll either get a Dell or ASUS as my next PC.

  • How to write good model to replace the string after a static string?

    Select regexp_replace ("Do replace not CONSTANT" VAR_123 "needs to be replaced", "CONSTANT" [A-Z0-9] ',' CONSTANT "REPLACE") twice;

    The output is:
    Does not replace CONSTANT 'REPLACEAR_123' SHOULD be replaced

    Output available is:
    Does not replace CONSTANT 'REPLACE' SHOULD be replaced


    What is the right model to solve my problem?

    Assistance is needed.


    Concerning

    possible alternatives

    /* replace everthing in between "" */
    select regexp_replace('Do not replace CONSTANT "VAR_123" should be replaced '
                        , '"([A-Z0-9_]*)"' ,'"REPLACE"')
    from dual;
    
    Do not replace CONSTANT "REPLACE" should be replaced 
    
    /* replace UPPER letters, Numbers and Underscore after keyword CONSTANT an in between "" */
    select regexp_replace('Do not replace CONSTANT "VAR_123" should be replaced '
                        , '(CONSTANT) "([A-Z0-9_]*)"' ,'\1 "REPLACE"')
    from dual;
    
    Do not replace CONSTANT "REPLACE" should be replaced 
    
    /* replace alphanumerica values including underscore after keyword CONSTANT an in between "" */
    
    select regexp_replace('Do not replace CONSTANT "VAR_123" should be replaced '
                        , '(CONSTANT) "([[:alnum:]_]*)"' ,'\1 "REPLACE"')
    from dual;
    

    One of the problems is that did ' t take you into account how the underscore character '_' is recognized.

  • How to use and control the tabs?

    Sorry for such a general question, but I use Firefox with older versions of Mac OS x for years and have just been struck by this brand new and I have no idea on your tabs, "new tab page" etc. Can you just send me some documents so I can understand what they are and how to use them?

    All I see on my headers Ff are all sorts of legs that have no relevance to me, like 'how to stop Firefox from... '. "(twice), a few other symbols Ff and other"tabs"I don't know everything." All the do is filling up a bar line.

    Thank you-

    You are welcome.

    If you have any other questions feel free to ask them.

  • How to use notes during the writing of my book with pages?

    How are used to write a book with pages of notes?

    You need the Apple EndNote plug-in for Pages v2.0and the EndNote 7.3.4 application (or later version) installed for compatibility El Capitan. With the plug-in installed and EndNote works, then you start Pages v5.6.1 and the Insert menu: reference EndNote is available for use. Launch Pages v5.6.1 prior to 7.3.4 EndNote and endnote reference entry in the Insert menu is not active.

Maybe you are looking for

  • Qosmio F10 - DVD RAM mast * a UJ - 830 s firmware 1.0

    Hi all. My work takes me to travel regularly in several countries and therefore, my DVD drive is running out of parts.I thought the point of having a laptop to use it everywhere.Well well, not in this case.The irony is that it affects only DVD legal

  • Ignoring the buffer overflow

    Is there a way of 'ignore' the buffer overflow error and leave the buffer to be overwritten without having to close and the process of acquisition and retune the radio report? I know that the first question is: "are you * sure * you do not want to do

  • Sound does not work, the troubleshooter did not work

    is not its workload is using push wrong can not detect a problem and im getting low static Original title: does not work its volume is help push bad cannot detect the problem and im getting low static

  • How do I access the function keys without having to press the fn on Pavilion g6 series

    Hello I just bought a g6 Pavilion and it's all good, except a big problem. For function keys, I have to press on the key fn first! It's horrible! Please fix. It should be easy to fix. This should be configurable. Come on, please don't play with the f

  • Desperate! Communication problem! And not only because I'm a man!

    Bought used Sony VAIO. Worked fine a couple years 120 GB Seagate died. A known good 160 GB of Dell dealer, reformatted, bought & loaded XP Pro SP3 for comp 'renovated' cannot connect to well-known bridge. No available for VAIO ethernet driver. Taken