Referencing REGEXP_REPLACE capture in other function

Here's the deal...
I've got a clob that I'm scrubbing with REGEXP_REPLACE to remove the instance of a specific string, then I want to use that string in a function call. I can see the string (on line 2 below) but can't get the function in line 3 to utilize it.
THE CODE
1 SELECT regexp_replace(wrk_clob, 'href=\s*"([^"]+)"',
2                    || '\1' || ':'
3                    || get_id_list(in_table, in_state, '\1')
4 INTO wrk_clob
5 FROM dual;
THE FUNCTION SPEC
FUNCTION get_id_list(
               in_table VARCHAR2,
               in_state VARCHAR2,
               in_doc_name VARCHAR2)
                         RETURN VARCHAR;
If I hardcode the value from line 4 into the in_doc_name position it returns properly. However, it does nothing - because '\1' does not point to any data - with this reference.
Any ideas where to go with this?
Thanks.
fordo82

Look here:
SQL> with t as (select '"111111" href="111"222' str from dual)
  2  select regexp_replace(str, 'href=\s*"([^"]+)"', '\1:'||decode(1,2,'asd','qwe')) yours,
  3         regexp_replace(str, 'href=\s*"([^"]+)"', '\1') yours2,
  4         regexp_replace(str, '.*?href=\s*"([^"]+)".*', '\1') mine,
  5         regexp_substr(str, 'href=\s*"([^"]+)"') subs1
  6          from t
  7  /
YOURS               YOURS2          MINE SUBS1
"111111" 111:qwe222 "111111" 111222 111  href="111"
SQL> If any questions rest - ask.
Message was edited by:
Volder
Whereas the piece that I have currently - regexp_replace(wrk_clob, 'href=\s*"([^"]+)"', - will cut out what the pieces I don't want.Can you provide an example of wrk_clob, and the result - you expect to get with this regexp_replace?

Similar Messages

  • [svn] 4184: Fix for @ see tag referencing a non-global package function generates an empty link@ href in DITA

    Revision: 4184
    Author: [email protected]
    Date: 2008-11-25 12:33:43 -0800 (Tue, 25 Nov 2008)
    Log Message:
    Fix for @see tag referencing a non-global package function generates an empty link@href in DITA
    Also now the deprecated should show up in the property and method summary table.
    and when @see results in an invalid href, an additional attribute called invalidHRef will be added to the dita file - this isn't picked up by xslt but will be consumed by FB.
    QE Notes: Some baselines may need to be updated due to new attribute for invalidHRef
    Doc Notes: None
    Bugs: SDK-18206
    tests: checkintests
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-18206
    Modified Paths:
    flex/sdk/trunk/asdoc/templates/asdoc-util.xslt
    flex/sdk/trunk/asdoc/templates/class-files.xslt
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/asdoc/TopLevelClassesGenerator.ja va

    Update!
    v3.1 has a major bug! Even though it may appear to work properly, strange characters may leak onto the end of URLs, and you may even get segfaults. Sorry I didn't properly test it before releasing it!
    Technical details:
    I calloc()ed the memory for the link href improperly, per:
    link = calloc((noprepend ? 0 : urllen) + i - s, 1);
    Once I fixed it with "+ 1", per:
    link = calloc((noprepend ? 0 : urllen) + i - s + 1, 1);
    it worked great.
    I may use a method that doesn't use a calloc() in the future; this works for now, and I'm not gonna knock it...
    Last edited by dav7 (2009-01-23 12:38:51)

  • Passing regexp_replace backreference to a function; type conversion problem

    I am trying to convert some text within my CLOB field to HTML links.
    The format of the (part of the link I am having problems with) is:
    <link 12>
    which I wish to convert to
    url_dest
    I am trying to pass the backreference \1 (being the number 12 in this case) in regexp_replace to a simple function I have made and when I run it I receive the error:
    ORA-06502: PL/SQL: numeric or value error: character to number conversion error
    I have tested the function on its own with passing a string and it works fine.
    I have passed the string from the backreference to the function and back out as the return value and it works fine.
    However, when I try to pass the string back reference (a set of digits) to use as the NUMBER ID in my where clause, it always returns this error. I have tried CASTing / TO_NUMBER in every way possible I can think of, using temporary variables etc. and still the same error.
    =====
    CREATE OR REPLACE
    FUNCTION GETLINK (linkid IN CLOB)
    RETURN VARCHAR2 AS
    linkstring VARCHAR2(4000);
    linkchar VARCHAR(4000);
    linkint NUMBER;
    BEGIN
    linkchar := TO_CHAR(linkid);
    linkint := TO_NUMBER(linkchar);
    SELECT url_dest INTO linkstring FROM TABLE WHERE ID = linkint;
    RETURN linkstring;
    END;
    =====
    Offending calling code:
    tempcontent := regexp_replace(myClobField, '<link ([[:digit:]]*)>', GETLINK('\1'));
    =====
    I have tried implicit and explicit type conversions that vary the above function; in parameters as VARCHAR2; etc.; no joy.
    Is this a bug within the database, is it by design, or is it just me making a hash of things? I really don't want to have to pull the XML into PHP then run the PHP regex functions with Oracle DB queries to do this!
    Many thanks for your assistance.
    Ingram

    Many thanks for the reply, but I'm not sure how that would work. I wish to do a global regexp_replace on all instances of '<link> ([[:digit:]]*)>' within my XML document, with the return value from the GETLINK function.
    So for instance.
    The return value of GETLINK could be in format:
    &lt;a href="\1"&gt;
    so an XML document of:
    =====
    &lt;doc&gt;
    &lt;link 12&gt;Test Link&lt;/link&gt;
    some content
    &lt;link 783&gt;A second Test Link&lt;/link&gt;
    &lt;/doc&gt;
    =====
    would return as:
    =====
    &lt;doc>
    &lt;a href="12"&gt;Test Link&lt;/link&gt;
    some content
    &lt;a href="783"&gt;A second Test Link&lt;/link&gt;
    &lt;/doc&gt;
    =====
    Obviously I would then do the other replacements to fix broken XML with the non matching end tags etc.
    TIA

  • I have a macbook pro version 10.7.5 and my mailbox will not open at all and comes up with a quit message even though it is not open. how can i get into my account. it works on my iPhone an i have internet and all other functions working on my computer

    I have a macbook pro version 10.7.5 and my mailbox will not open at all and comes up with a quit message even though it is not open. how can i get into my account. it works on my iPhone and i have internet and all other functions working on my computer

    Launch the Console application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Console in the icon grid.
    Step 1
    Make sure the title of the Console window is All Messages. If it isn't, select All Messages from the SYSTEM LOG QUERIES menu on the left. If you don't see that menu, select
    View ▹ Show Log List
    from the menu bar.
    Enter the name of the crashed application or process in the Filter text field. Select the messages from the time of the last crash, if any. Copy them to the Clipboard by pressing the key combination command-C. Paste into a reply to this message by pressing command-V.
    When posting a log extract, be selective. In most cases, a few dozen lines are more than enough.
    Please do not indiscriminately dump thousands of lines from the log into this discussion.
    Important: Some private information, such as your name, may appear in the log. Anonymize before posting.
    Step 2
    In the Console window, look under User Diagnostic Reports (not "Diagnostic and Usage Messages") for crash reports related to the crashed process. The report name starts with the name of the process, and ends with ".crash". Select the most recent report and post the entire contents—the text, not a screenshot. I know the report is long. Please post all of it anyway.
    In the interest of privacy, I suggest that, before posting, you edit out the “Anonymous UUID,” a long string of letters, numbers, and dashes in the header of the report, if it’s present (it may not be.)
    Please don’t post other kinds of diagnostic report—they're very long and rarely helpful.

  • Can i upgrade my laptop's graphic card? and how does this upgrading affect the other functions?

    is it possible to upgrade my HP Split 13-m111TU x2 PC's graphic card? how does one go about this upgrading process? does it affect the other functions and features of the laptop? 

    Hi:
    The graphics adapter in your model cannot be upgraded.

  • Hello apple guys, i can't open app store, reminders, contacts, mail(crash), maps, Image Capture, and other apps that comes with Mavericks OS, how i can solve this problem?

    hello apple guys, after installing OS X Mavericks, i can't open app store, reminders, contacts, mail(crash), maps, Image Capture, and other apps that comes with Mavericks OS, how i can solve this problem?

    So is this the way Apple works now? Not solving customers problems? I'm sure so many users have had this problem. I've had, and I reinstalled Mavericks 3 times. Works fine for some days and then several Apple Apps stop working. Is that a way to force us ti update to Yosemite? (I don't want to) and then pay to update some third party programs (i.e. Pro Tools). Also, there are so many 15" MacBooks Pro with graphic problems and of course the guys at the Apple Service Centers always say: "It's the logic board, you can have it replaced, but it's so expensive I would recommend a new Mac".  I really, really miss Steve Jobs!

  • I updated my iPad 4 to ios 7.0 now app info sheet hangs up in App Store screen-pressing other functions at store doesn't work. Help!

    I updated my iPad 4 to ios 7.0 and now app info sheet gets "stuck" in App store screen. When this occurs,selecting other functions (like Update,Purchased,
    Search,etc.) does not help. Sometimes, opening Safari or maybe Google ( not sure about Google ) and going to a website gets rid of  the problem and
    sometimes it doesn't. I forgot to mention that if I select a different app to look at (through Apps Gone Free,or Free App a Day,etc.,that app will show up
    on top of the hung-up app and can be made to leave. However, the original app remains.Has this problem happened to anyone else,and was
    there a remedy for it ? Also,is there a user who had this problem and then updated to 7.0.1 and had this annoyance go away ? If so, did your device
    develop new difficulties because of this update ? Thanks.

    Fully close the App Store App.  Double tap your home button which will bring the most recently used apps.  You'll see the app icon below and a screen shot of the open app page above.  With your finger, swipe the open app page upward and the app will close.  It's a good idea to regularly close apps when yout using them.
    Tap your home button once to bring back your home screen.
    App store should operate normally again when you open it.

  • A function to announce or to do some other functions when a dataset is loaded successfully?

    What is the function to listen to the data and announce or do
    some other functions when the data is loaded successfully and ready
    to use?
    I've tried the getDataWasLoaded() but I must do it manually,
    or use it with the setTimeOut() function to check, this really
    unuseful.
    Thanks for all your help.

    U can use observers for that, the observer onPostLoad
    indicates that the data is ready to be processed.
    u can find the info in this document;
    http://labs.adobe.com/technologies/spry/articles/data_set_overview/index.html

  • My iPod Touch will not play through external speakers when it is docked.  It only plays through it's internal speaker.  All the other functions on the iPod can be controlled by the external speakers (volume,track, etc).  How do I fix this?

    My iPod Touch will not play through external speakers when it is docked.  It only plays through it's internal speaker.  All the other functions on the iPod can be controlled by the external speakers (volume,track, etc).  How do I fix this?

    I would try in oreder:
    - Resetting the iPod:
    Press and hold the On/Off Sleep/Wake button and the Home
    button at the same time for at least ten seconds, until the Apple logo appears.
    - Restoring the iPod via iTunes.  First from backup and if problem persists, restore to factory defaults/new iPod.

  • My Ipad2 won't turn off.  I've tried the reset method,  holding both buttons down for at least 10 seconds, but this doesn't work. I'm on version 5.1.1 and all other functions work except that I cannot get onto the internet via wi-fi either.  Help ??

    My Ipad2 won't turn off.  I have tried the reset method by holding both buttons down for at least 10 seconds, but this doesn't work.  I can't get onto the internet via wi-fi either (don't have a 3G card fitted).  All other functions seem to be working OK including charging. Not had this problem before, but I recently upgraded software to 5.1.1 so is there a bug in there somewhere?

    Look at last link.
    Look at iOS Troubleshooting Wi-Fi networks and connections  http://support.apple.com/kb/TS1398
    iPad: Issues connecting to Wi-Fi networks  http://support.apple.com/kb/ts3304
    iOS: Recommended settings for Wi-Fi routers and access points  http://support.apple.com/kb/HT4199
    Additional things to try.
    Try this first. Turn Off your iPad. Then turn Off (disconnect power cord) the wireless router & then back On. Now boot your iPad. Hopefully it will see the WiFi.
    Go to Settings>Wi-Fi and turn Off. Then while at Settings>Wi-Fi, turn back On and chose a Network.
    Change the channel on your wireless router. Instructions at http://macintoshhowto.com/advanced/how-to-get-a-good-range-on-your-wireless-netw ork.html
    Another thing to try - Go into your router security settings and change from WEP to WPA with AES.
    How to Quickly Fix iPad 3 Wi-Fi Reception Problems
    http://osxdaily.com/2012/03/21/fix-new-ipad-3-wi-fi-reception-problems/
    If none of the above suggestions work, look at this link.
    iPad Wi-Fi Problems: Comprehensive List of Fixes
    http://appletoolbox.com/2010/04/ipad-wi-fi-problems-comprehensive-list-of-fixes/
    Fix iPad Wifi Connection and Signal Issues  http://www.youtube.com/watch?v=uwWtIG5jUxE
    Unable to Connect After iOS Update - saw this solution on another post.
    https://discussions.apple.com/thread/4010130?tstart=60
    Note - When troubleshooting wifi connection problems, don't hold your iPad by hand. There have been a few reports that holding the iPad by hand, seems to attenuate the wifi signal.
    ~~~~~~~~~~~~~~~
    If any of the above solutions work, please post back what solved your problem. It will help others with the same problem.
     Cheers, Tom

  • My apple Tv will not airplay, this is the 3rd one i have exchanged and my devices airplay just fine elsewhere, could there be a problem with the wifi even though all of the other functions are working fine?

    My apple Tv will not airplay, this is the 3rd one i have exchanged and my devices airplay just fine elsewhere, could there be a problem with the wifi even though all of the other functions are working fine?

    Hello there, AntRambo.
    The following Knowledge Base articles may provides some steps to go over for troubleshooting your issue:
    iOS and OS X: Recommended settings for Wi-Fi routers and access points
    http://support.apple.com/kb/HT4199
    And also the following:
    iOS: Troubleshooting AirPlay and AirPlay Mirroring
    http://support.apple.com/kb/TS4215
    Particularly but not exclusively of note:
    If the AirPlay icon doesn't appear
    Ensure that you have followed the steps in using AirPlay and AirPlay Mirroring.
    If you are still unable to see the AirPlay icon  , try one of the following steps:
    If trying to AirPlay, or AirPlay mirror, to your Apple TV, ensure that AirPlay is enabled on your Apple TV as well. You can enable or disable AirPlay on Apple TV in the AirPlay menu: Settings > AirPlay.
    Check Internet or network connectivity on all affected devices. Some content requires an Internet connection to authorize content playback. AirPlay capabilities may be limited if your network is not connected to the Internet.
    If attempting to use AirPlay from a third-party app or a website from your Safari app on your iOS device, confirm that the app or website is AirPlay compatible (refer to the developers of the app or website for additional information).
    Thanks for reaching out to Apple Support Communities.
    Cheers,
    Pedro

  • How do I hide my mailbox and mail contents from other users, leaving other functions of my iMac accessible?

    How do I hide my mailbox and mail contents from other users, leaving other functions of my iMac accessible?

    You don't have to shut down the computer to switch accounts. All you do is click the Apple symbol in the upper left and choose Log Out and that's it. You can also set up Faster User Switching by:
    1. Open System Preferences - Accounts
    2. Click Login Options
    3. Check the box called "Show fast user switching menu as" then choose from either icon, short name or name.
    Then when someone wants to switch users they can. The advantage of this method is if you are have a document open and don't want to close it the document will remain open. If the other user attempts to shut down the computer they can't until you have logged out thereby saving all your data.
    A very simple and elegant solution.

  • Can I use a deactivated verizon G'zOne Ravine phone for its nonphone properties such as the alarm and other functions? Do I have to do anything special?

    Can I use a deactivated verizon G'zOne Ravine phone for its nonphone properties such as the alarm and other functions?
    Do I have to do anything special?

    Just charge it

  • HT4623 i have 4s and the operating system is iOS 5.1.1  got the update message of iOS 6. if update the iOS 6, other functions will work unchanging?

    I have apple 4s and the operating system is iOS 5.1.1  got the update message of iOS 6. if update the iOS 6, other functions will work unchanging?

    What other functions?
    There have been some wifi related issues reported with the 4S being updated to IOS 6. There is no turning back once you update so keep that in mind.
    I recommend updating via iTunes so that you make a backup of all your data. You may want to make an iCloud backup as well.
    Other than that, I don't understand what other functions you are concerned about?

  • As FI consultant, What are critical issues with other Functional Consultant

    Hai,  Masters
    Can you express about Critical issues with other functional consultant with exmples
    Regards
    Ramesh K

    Hi Ramesh K,
    I think the critical issue should be the definaition cross application should be consistency( Ex in FI, CO, MM or SD).
    And the Main issue is the result updated from FI to other applications or from other applications to FI is correct or not!
    With Best Regards,
    Gladys Xing

Maybe you are looking for

  • I have firefox 4.0.1 on vista laptop and it crashes when i try to use add-on manager

    today in the morning everything was ok, this afternoon firefox started crashing when i tried to access Frontierville on Facebook... i installed fresh version of flash player but no help.contacted makers of the game about that...but in the evening whe

  • Print too small, tried everything (I think..)

    Hi I recently installed the driver for this printer from the HP site and replaced some empty ink cartridges. So, printer now prints. Trouble is, whatever I do in Preferences, or in Word, Acrobat, anything, the page prints too small and centred. The s

  • Pictures lost in ipod

    I spent a few days in Athens and took about 300 pictures. I transferred them with the camera connector on my 20Go ipod (bought in august). Of course, I erased the compact flash. And then, while trying to transfer them to my ibook: 200 pictures lost.

  • Forms applet doesn't respond anymore

    Hi, Migrating to SunJVM 1.6.0_07 (JPI) our forms application sometimes crashes. It happens when dragging the mouse over the value displayed in a text field. About once a month on a normal PC and a couple of times a day on a virtual client. It never o

  • Duplicate and triplicate e-mails

    Hello everyone, Sorry if I'm in the wrong forum. I am at wits end trying to figure out how to avoid or stop duplicate, triplicate and sometimes even four times receipt of the same e-mail from everyone, whether they are in my address book or not. My s