Special characters escaped HOWTO if you use regexp_replace and regexp_substr

Hello experts,

following test case

insert into querytest1 (d) values

("#1 (170): [{'type': 'FACEBOOK', 'count': 0, 'Larry': 1382627403299}, {'type': 'GOOGLE', 'count': 0, 'Larry': 1381825285002}, {'type': 'EMAIL', 'count': 2, 'Larry': 1381826322925}] #2(0): #3 (5):-3141 #4 (5):-3141 #5 (5): 21804 #6: (7) 3890750 #7(3): s11'");

Select regexp_replace (d, REGEXP_SUBSTR (REGEXP_SUBSTR (d, ' [^] +', 1, 1), "[^:] +' 1, 2"), ") of querytest1;

ERROR on line 1:

ORA-12726: unparalleled support in regular expression

evidence that the characters special [] {} are the problem:

delete from querytest1;

commit;

-Insert data without special characters

insert into querytest1 (d) values (' #1 (170): 'type': 'FACEBOOK', 'count': 0, 'Larry': 1382627403299, 'type': 'GOOGLE', 'count': 0, 'Larry': 1381825285002, 'type': 'EMAIL', 'count': 2, 'Larry' [: 1381826322925] #2(0): #3 (5):-3141 #4 (5):-3141 #5 (5): 21804 #6: (7) 3890750 #7(3): s11');

Select regexp_replace (d, REGEXP_SUBSTR (REGEXP_SUBSTR (d, ' [^] +', 1, 1), "[^:] +' 1, 2"), ") of querytest1;

REGEXP_REPLACE (D, REGEXP_SUBSTR (REGEXP_SUBSTR(D,'[^]+',1,1),'[^:] +', 1, 2), ")

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

[#1 (170): 'FACEBOOK', 'count': 0, 'Larry': 1382627403299,: 'GOOGLE', 'count': 0, 'Larry': 1381825285002,: 'EMAIL', 'count': 2, 'Larry': 1381826322925,: 'EMAIL', 'count': 2, "Lamarre": 1381826322925] #2(0): #3 (5):-3141 #4 (5):-3141 #5 (5): 21804 #6: (7) 3890750 #7 (3): s11

so now it works because there is no characters [special])

is there a way to escape them?

Thank you in advance.

Hello

Since you are using Oracle 11.2, you can do it with a WITH recursive clause, like this:

MERGE INTO dst t

WITH THE HELP OF)

MORPHING (q, result, n_to_do, start_pos, end_pos) AS

(

Q SELECT

,       d || ' ' AS a result

REGEXP_COUNT (q

, '#\d+\(\d+\):'

) AS n_to_do

REGEXP_INSTR (q,

, '#\d+\(\d+\):'

1

REGEXP_COUNT (q

, '#\d+\(\d+\):'

)

) AS start_pos

LENGTH (q) AS end_pos

T

UNION ALL

Q SELECT

REPLACE (result

, ':' || n_to_do | ' '

, NVL (RTRIM (REGEXP_SUBSTR (SUBSTR (q, 1, end_pos))))

, '#\d+\(\d+\):(.*)'

start_pos

1

NULL

1

)

)

, 'NULL '.

)

) AS a result

, n_to_do - 1 AS n_to_do

REGEXP_INSTR (q,

, '#\d+\(\d+\):'

1

BIGGER (1

, n_to_do - 1

)

) AS start_pos

REGEXP_INSTR (q,

, '#\d+\(\d+\):'

1

n_to_do

) - 1 AS end_pos

MORPHING

WHERE n_to_do > 0

)

Q SELECT, result

MORPHING

WHERE n_to_do = 0

) CBC

WE (dst.q = src.q)

WHEN MATCHED THEN UPDATE

SET dst.result = src.result

;

You can have any number of rows in table t, but they must have a unique key.  I assumed q was unique, highest, but it can be a column or combination of columns.

It works with any number of values.

The character "#" can occur in the values, just that it does not part of the point of shells #-figures-leftparen-figures-rightparen-colon. If "#" occurs in this model, you can't simplify regular expressions, as John.

The above solution was written for the table that you posted in response #6, where q contained values, and d was the formula with the holders of the place for values.  You seem that overthrew in your last message, you may need to reverse I used q and d.

Whatever your problem, it seems to be a way very uncomfortable to solve.  You need to rethink your data model.  In particular, stroring data in delimited as q lists are a bad idea.  Relational databases work best when when each column contains a single value, not a list of any number of values.  It is so basic to the design of database he called first normal form.

This would help a lot if post you more simple examples.  Instead of having 7 values, some close to 200 characters, you could show the problem just as well (better, in fact) with 3 or 4 values, no tha 10 don't characters each.

Tags: Database

Similar Questions

  • Chinese characters appear from nowhere, then using find and replace in dreamweaver

    It is a strange, Chinese characters appear from nowhere, then using find and replace (in the folder) in dreamweaver. the replacement text is Chinese characters on the open document, others are ok

    Sounds like the Configuration of your entire file is damaged.

    Rename your folder Dreamweaver MX\Configuration Old_Configuration.

    When you restart Dreamweaver, it will create a new Configuration file for you.

    Good luck!

    Nancy O.

  • CC of Dreamweaver generates one of the 3 error messages when you use find and replace on 8.1 Win 64 bit.

    CC of Dreamweaver generates one of the 3 error messages when you use find and replace is used more than twice in a row. "While executing onLoad in bc_afterSave.htm, the following JavaScript error occurred: at line 188 of file C:\Program Files (x 86) \Adobe|. Adobe DreamweaverCC | Configuration | Shared | ' BC\JS\bc_sites.js': out of memory.

    or

    When executing RunCommand in File_Save.htm, a JavaScript erroroccurred.

    or

    While exciting getDynamicContent inAdressURL.htm, an erroroccirred of Javascript.

    Any thought - I find myself CBWMS of closing and reopening. Will work for the other two find and replace once again before the popup of messaged\s error.

    Cough, cough, cough - 38 500 pages? !  Really?  It's a big site!

    I'm not surprised, that you are short of memory.  Try to limit your F & R records or select files rather than the entire Site.

    Nancy O.

  • When you use gmail (and perhaps at other times too) I get repeated pop-ups showing [JavaScript Application] Exc in ev handl: TypeError: oSAPlg.oRoot.log is not a function. How can I stop this?

    In addition to the above pop-up message, sometimes I get the following:

    [JavaScript application]
    EXC in ev handl: error: Bad NPObject as private data!

    These pop - ups prevent me from doing anything on the computer until I close the window pop up, which is sometimes quite difficult.

    Do you use the McAfee Site Advisor? It caused this message. Disable tab of the Add-ons Manager > Extensions until McAfee can fix it.

  • How file, edit, view, go, tools etc. to stay in sight all the time? When you use word and windows mail please

    I really want to stay in sight all the time, having to press ALT to see for a brief moment becomes very annoying.

    Any help will be much appreciated. Thank you

    J

    Hello jc2711,

    Thank you for visiting the Microsoft answers community.

    Depends on what applications you are using and what version of these applications.

    Please let us know what you use and we can give some advice.

    Thanks Chris.H
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • If you use CFHEADER and CFCONTENT to disseminate an Excel file, Javascript still works?

    Hello, all,.

    I use a hidden iFrame which loads a page using CFHEADER and CFCONTENT to disseminate an Excel of a form submission.  I'm _trying_ to use JavaScript to change the value of the button element that sends the form to the parent page.

    I see no success.  JavaScript still works when a page using CFHEADER and CFCONTENT?

    I can't even a simple JS alert() to work.

    V/r,

    ^_^

    I don't expect Javascript to run when you use,

    These tags Coldfusion binary content, i.e. sending code Excel, result to the browser.

  • Photoshop CS4 crashes when you use shift and the move tool

    Help, please!

    Whenever I click on a layer with the tool move while holding the shift key (so I can limit the movement), photoshop crashes.  I get a message that says: "could not use the tool to travel because of a program error." And then photoshop just stop.

    Now I can use the move tool without holding SHIFT, but as soon as I hit the shift button and tried together... crash!

    What is going on?

    I was wondering if it has something to do with an updated video driver I installed yesterday.  He was not doing this before that.

    Suggestions anyone?  Please please please help!

    Have you tried to roll back the driver to see if the fault disappears?

    Alternatively, you can try to reset your preferences as described in the FAQ.

    http://forums.Adobe.com/thread/375776?TSTART=0

    You must physically delete (or rename) the preference files or, if you use the Alt, Ctrl, and shift, don't forget you get a confirmation dialog box.

    This resets all settings in Photoshop default.

    (A complete uninstall/reinstall will not affect preferences and a corrupted file may be the cause of the problem.)

  • can someone tell me why I get an error of iw3mp.exe when you use Skype and games?

    While using Skype and play a game online, I always get an error of iw3mp.exe. I have uninstalled and reinstalled my sound card and it works for awhile, but the error then begins again.

    http://www.Google.com/search?q=iw3mp.exe+ERRO&ie=UTF-8

  • I get the following message when you use Safari and Firefox. Works in Chrome: "we're sorry, the link that brought you to this page is not valid."

    I'm working with my bank account online and I get to the homepage very well. When I select the online banking, estatements, I get the following message when it tries to link to the electronic statement page.
    "We're sorry, the link that brought you to this page is not valid." Chrome has no problem displaying this page, but Firefox and Safari gives me the same message.

    Note that I posted this already above, but don't not checked if she was tried.

    You may need to allow cookies from third party (visited or all).


    To view the history settings and cookies, choose:

    • Firefox > Preferences > privacy > Firefox will be: "use the custom settings for history".
  • If you use Firefox and Bing, search auto suggestions will not meet even if all options for this are enabled.

    If I try to search using Firefox as my browser and Bing as my search engine, auto suggestions will not fill. Can I use any other search engines with Firefox and they work and I use Bing in other browsers, and it works.

    If you have installed security software (antivirus, firewall etc.), you can try to remove all instances of Firefox and its process/associated files in all modules/areas of different configuration software safety like surveillance process, spawned the sub/process control, virtualization, HIPS etc., in addition to the main security software control panel. Instead create new rules entirely authorized/reliable for Firefox + its associated processes in all the different modules/panels - one installer of Firefox as well as all real/original exe (Application) installed and DLLs (Application extension) is digitally signed by Mozilla Corporation (right click > properties > Digital Signatures). Even otherwise, some security software may also ask again when Firefox and/or its sup processes are started, and you can be able to allow/trust at this time. Please see this.

    The AV/Firewall configuration

    If security software problems can be excluded, you can also reset Firefox and check.

    The reset Firefox feature can solve a lot of problems in restaurant Firefox to its factory default condition while saving your vital information.
    Note: This will make you lose all the Extensions, open Web sites and preferences.

    To reset Firefox, perform the following steps:

    1. Go to Firefox > help > troubleshooting information.
    2. Click on the button 'Reset Firefox'.
    3. Firefox will close and reset. After Firefox is finished, it will display a window with the imported information. Click Finish.
    4. Firefox opens with all the default settings applied.

    Information can be found in the article Firefox Refresh - reset the settings and Add-ons .

    This solve your problems? Please report to us!

  • Is it normal if my iPhone 6s Gets a little warm when you use normally and cold when not in service?

    My iPhone hot used the afternoon to the evening but after reset 6s, things return to normal. Now, my iPhone 6s Gets a little warm in the back of the phone, and sometimes on both sides of the phone. It's cold when not in service. Is this normal? Help me!

    NO it's not. Your battery is private. Check with Apple. You might need a new battery. Yesterday my curved screen. I have an appointment with Apple Genius Bar to see if it can be replaced for free. I will keep you updated.

  • You can use wireless controller if you use Plug-and-play?

    Hello, I was wondering, is it possible to use a wireless controller with my pc, if I use a plug and play?

    If the wireless controller is equipped with a usb port on the computer to connect to it, then it is probably intended for use on the PC. You can't just use a PS3 or Xbox controller on the computer just like that.

  • Have the intermittent connection when you use WiFi and conflict error IP address when using Ethernet

    I have intermittent problems with my wireless internet connection. I contacted the ISP and they analyzed the configuration of the modem-router, changed some and told me to try to reconnect. I try again and the connection is OK. The ISP has caress each other on the back and sent me on my merry way not-so-small. Problem is at an unpredictable time, problems (do) happen.

    Usually the failure scenario does not have a huge problem - plus one
    gene as a problem. I just keep trying to connect through Windows
    Network and sharing Center, and possibly the connection is made. But in some cases, time is critical; I eventually lose 10 to 20 minutes of typing-search-typing-correction-etc in a web form when the connection disappears before making a SHIPMENT. (Some time, after the failed wireless and re - connect, I was actually able to recover pretty quickly that the site has not been exceeded me.) So in this scenario I can't lost any strike.)

    I would like to connect my pc to the internet via an ethernet cable
    the modem-router. I could take this approach right after the wireless
    connection failed. Or in a preventive way, when I know I'll be typing-
    mode of research-type-fixed-etc and I want to be really sure. When I tried this, I get the error "Windows has detected an IP address conflict.

    What I do at this point to get around the Wi - Fi connection and connect through the Ethernet cable?

    The topic is edited for clarity of the moderator.* *.

    [Original title: LOST INTERMITTENT WIRELESS INTERNET CONNECTION]

    It is not clear what parameters your ISP technology management may have changed on your modem/router.  As a general rule, the ISP concerned the link between their server and your modem, but any fiddling with settings that control this link will not effect either on the link between your computer and the modem/router.

    If you still haven't reset your router to its default settings, do not unless you know the necessary internal router settings for you connect to your ISP.  If you have a cable Internet connection, the default settings may work OK, but if you have a DSL, they probably won't.

    You should not get this "IP address conflict" error when you connect the Ethernet cable.  Follow these steps:

    Open the "network and sharing Center" and then click on "change adapter settings".  You should see an icon for your wireless network adapter and an icon for your 'connection to the Local network' (your Ethernet connection).

    • Right click on each of the icons, and select 'properties '.
    • There should be a list titled "this connection uses the following items."  In this list, select "Internet Protocol Version 4 (TCP/IP)" and then click "Properties".
    • The radio buttons to "Obtain an IP address automatically" and "Obtain DNS server address automatically" should both selected.  If this is NOT the case, do so and OK your way out.  Furthermore, cancel your way.

    If a card has been configured to use a specific IP address, your "IP address conflict" should now be fixed (you may need to restart the computer for the change to take effect).

    If cards were already configured to obtain its IP address automatically, the problem lies in the configuration of your router.  You will need to access the router's Web utility to study and make changes.  To help you provide the brand and model of the router of the label on the back or the bottom.  Also do the following to a time where you have an Internet connection:

    Open a command prompt window (type cmd in the search box and press enter)

    1. In the black command prompt window, type the following command, and press ENTER after each line

    ipconfig/all > "% userprofile%\Desktop\ipinfo.txt".

    Notepad '% userprofile%\Desktop\ipinfo.txt '.

    output

    1. In the opened Notepad window, click Edit > select all (or press CTRL + A) and then click Edit > copy (or press Ctrl + C)
    2. In the body of your Question, right-click > paste (or press CTRL + V) the data of the Notepad window
    3. Close Notepad and remove ipinfo.txt from your desktop
  • BlackBerry smartphone Curve 8900-can you use apps and internet without a SIM (ATT)

    I have a blackberry curve 8900 I bought for cheap thinking I could use it to just WiFi and apps... is true or was a mistake? If it is true, how do I do that?

    How can you check what OS I use... I'm new to blackberry

  • Adjust the size of the frame of the focus when you use Pan and zoom tool in first 14?

    I'm learning to use the pan & zoom tool through Adobe's Classroom in a Book for first elements 11.  The book is excellent, but as his writings for a generation of software of creation that is 3 years old, I'm trying to tackle a smaller image section that lets you control the default structure more small bowl size. (using the angle of the image update)

    Is it possible to adjust the image to a size smaller than the smallest default size allowed?  Thanks for your help!

    provlima

    I am not 14 as being different from 11 regarding the resizing of the workspace Pan and Zoom focus frame (by clicking on - or +). And I have not found a way to adapt a framework of development less than its smaller default size allowed using the-. or otherwise.

    RTA

Maybe you are looking for