Replace  between [ and ]

Hi can someone give me a simple example of how to replace all characrters between '[' and ']' with one hardcoded string , eg schema name.
I know how to do it with instr but looing for something straightforward with reg exp probably
Edited by: Keith Jamieson on Sep 29, 2010 12:00 PM

This works also for more than one pair of brackets:
select regexp_replace('aaaaaaaa[1111]bbbbbbbbbbbbb[222]ccccc[3333]cccc',
                               '\[[^]]*\]',
                               '[yourtext]')
from dual;

Similar Messages

  • Battery keeps fluctuating between "Replace Soon" and "Normal"

    I have noticed that over the past few weeks, my battery continues to fluctuate between 43% health (Replace Soon) and 95% health (Normal).
    The weird part is that, when the battery is listed as 95% health, it functions normally (2 hours of charge). However, when the battery is listed as 43% health, it lasts significantly less even when doing the same light web browsing.
    Anyone have any ideas? Replace the battery? Is it defective? Thanks!

    1, 668 cycles is a good life for a battery that is expected to hold about 80% capacity after 300 cycles.
    2. 668 is a lot for an 18-month old battery--that's well over one cycle per day. You are using your battery hard, apparently for hours and hours every day. It shouldn't be surprising that it's being schizophrenic in its reporting to the OS about its status. When you get your new battery--yes, I am sure you need one--treat it better. Use it plugged in when power is available, unplugged when not, and calibrate it every six or eight weeks. Some reading:
    http://www.apple.com/batteries/
    http://www.apple.com/batteries/notebooks.html
    http://docs.info.apple.com/article.html?path=Mac/10.6/en/9036.html

  • Difference between " " and ' ' in oracle

    Hi
    What is the difference between " " and ' ' in oracle

    Generally, single quotes ' are used as string delimiters. Double quotes are NOT string delimters in SQL, but are used to preserve the precise representation of what's enclosed - for instance, "abc" would be recognized as lowercase in situations where SQL would automatically translate them into upper case. Thus, something like
    SQL> select dummy as "dummy"
      2    from dual;
    d
    Xmeans to select the dummy column but preserve the name in lower case where normally the 'd' in the column name (cut off) would be 'D'
    Using empty strings to represtent nulls has already been discussed on this thread. Remember that spaces are NOT nulls. I personally find the replace-null-with-space method a bit clunky, but a lot of mainframe-to-oracle conversions use it.

  • When I open Mail the screen flickers random blue and gray appeared on the screen. I took a video too. Will that happen again? Is it hardware problem? This ipad2 32GB was replaced yesterday and I think it is refurbished. Are replace product refurbished?

    I got my ipad2 replaced yesterday. And this new ipad started giving me problem by crashing aps. Then I restored the ipad twice but the problem was still there. I called apple and they fixed it by doing Reset All Settings. But now I have this weird problem. When I open Mail the screen flickers random blue and gray appeared on the screen. I took a video too. Will that happen again? Is it hardware problem? This ipad2 32GB was replaced yesterday and I think it is refurbished. Are replace product refurbished?

    There is no way for anyone here to know if your replacement iPad is a refurbished unit.  Per Apple's replacement policy, replacements can be refurbished units.  If you feel the unit is not working correctly, take it back, let them check it out and if found defective, they will replace that unit.

  • Folder action to find and replace text and change line feeds

    I want to use a folder action to find and replace text and change Mac carriage returns to DOS line feeds inside text files.
    The text to be replaced is: "/Users/wim/Music/iTunes/iTunes Music/Music" (without the quotes)
    This text has to be removed (i.e. replaced by an empty string)
    The text occurs many times within each file.
    The files are playlists exported from iTunes in the M3U format (which are text files). They contain Mac carriage returns. These need to be changed to DOS line feeds.
    I have found the following two perl commands to achieve this:
    To find and replace text: perl -pi -w -e 's/THIS/THAT/g;' *.txt
    To change carriage returns to line feeds: perl -i -pe 's/\015/\015\012/g' mac-file
    I know that it's possible to make a folder action with Automator that executes a shell script.
    What I want to do is drop the exported playlists in M3U format in a folder so that the folder action will remove the right text and change the carriage returns.
    My questions are:
    Is it possible to make a folder action that executes command line commands instead of shell scripts?
    What is the correct syntax for the two commands when used in a folder action shell script? Especially, how do I escape the slashes (/) in the string to be removed?
    Thanks for your help

    Ok, I've include an applescript to run a shell command. The applesript command quoted form makes a string that will end up as a single string on the bash command line.  Depending on what you want to do, you may need multiple string on the bash command lines.  I've included some information on folder actions.
    It is easier to diagnose problems with debug information. I suggest adding log statements to your script to see what is going on.  Here is an example.
        Author: rccharles
        For testing, run in the Script Editor.
          1) Click on the Event Log tab to see the output from the log statement
          2) Click on Run
        For running shell commands see:
        http://developer.apple.com/mac/library/technotes/tn2002/tn2065.html
    on run
        -- Write a message into the event log.
        log "  --- Starting on " & ((current date) as string) & " --- "
        --  debug lines
        set desktopPath to (path to desktop) as string
        log "desktopPath = " & desktopPath
        set unixDesktopPath to POSIX path of desktopPath
        log "unixDesktopPath = " & unixDesktopPath
        set quotedUnixDesktopPath to quoted form of unixDesktopPath
        log "quoted form is " & quotedUnixDesktopPath
        try
            set fromUnix to do shell script "ls -l  " & quotedUnixDesktopPath
            display dialog "ls -l of " & quotedUnixDesktopPath & return & fromUnix
        on error errMsg
            log "ls -l error..." & errMsg
        end try
    end run
    How to set up a folder action.
    1) right click on folder. click on Enable folder actions
    2) Place script in
    /Library/Scripts/Folder Actions Scripts
    3) right click on folder. click on attach folder action
    pick your script.
    Create a new folder on the desktop & try.
    You can put multiple folder actions on a folder. There are other ways of doing this.
    Here is my test script:
    on adding folder items to this_folder after receiving dropped_items
        repeat with dropped_item_ref in dropped_items
           display dialog "dropped files is " & dropped_item_ref & " on folder " & this_folder
        end repeat
    end adding folder items to
    How to  make the text into an AppleScript program.
    Start the AppleScript Editor
    /Applications/AppleScript/Script Editor.app
    In Snow Leopard it's at: /Applications/Utilities/AppleScript Editor
    Copy the script text to the Applescript editor.
    Note: The ¬ is typed as option+return.  ption+return is the Applescript line continuation characters.
    You may need to retype these characters.
    Save the text to a file as an script and do not check any of the boxes below.

  • Hard drive crashed on my MacBook pro and had to replace drive and logic board.  When I connect my iPhone and try to sync I get a dialog box stating iPhone is synced with another iTunes library, erase and sync?  How do I sync with iTunes without erasing?

    Hard drive crashed and had to replace drive and logic board on my MacBook pro.  After Install tried to sync with my iPhone and a dialog box pops up stating "this iPhone synced with another iTunes library, erase and sync?".  I checked the manually manage music and videos box because I don't want all my wife's pics and music on my iPhone.  How do I Sync without erasing what I have on my iPhone???

    columbus new boy wrote:
    How crap is that?
    It's not crap at all.
    It's not that simple. For example, I've 3500 songs on my MacBook but don't want them all on my phone, so I have to manually select each song again???
    There has to be a solution.
    Why not simply make a playlist with the songs you want on the iPhone?
    and maintain a current backup of your computer.

  • If I'm already paying 149.99 to replace my water damaged Iphone 4 can I pay the Iphone 4s replacement price and get that instead? If No explain why please . Thank you

    I have a water damaged Iphone 4 I have had for only 8 months. Today I went to the apple store to see how much a replacement was and the girl told me 149.99 for my iphone. What I was wondering is can i pay the replacment cost of an Iphone 4s and get that instead . I dont see the problem since my phone is broken anyways . But I would like to hearf if any one has tried the same thing.
    Thanks

    The only exception would be if there were no like models available.  There was a short period when there were not sufficient supplies of the 3gs to effect warranty replacements.  In that case, they replaced the 3GS with a 4 at no additional charge.  But the warranty fine print specifies that they will repair or replace the device, at their discresion. 

  • I had to get a replacement phone and have lost my contacts. The old phone was backed up on my laptop and not iCloud is there any way I can get them back?

    I had to get a replacement phone and have therefore lost my contacts. Does anyone know how I can get them back considering that I backed up my old phone on my laptop and not iCloud?

    if you have itunes on your PC/MAC sync the replacement iPhone using the last backup from the defective device

  • My HD died on my iMac. I replaced it and lost everything that was on it. I found my source disks from my original purchase for Final Cut Express HD 3.5.  I now have Maverick ISO and it will not let me load my software so I can continue my film work. ???

    My HD died on my iMac. I replaced it and lost everything that was on it. I found my source disks from my original purchase for Final Cut Express HD 3.5.  I now have Maverick ISO and it will not let me load my software so I can continue my film work. How do I get it too recover it without paying for it again since I paid for it already and have projects in progress that need to be completed?

    1) Partition your hard drive or add an external drive and install Snow Leopard (with the Optional Rosetta) into it and then you can dual-boot (System Preferences:Startup Disk) into Snow Leopard and run FCE 3.5 there.
    2)  Use one of the following methods to install FCE 3.5 into Mavericks:
    a)  Pacifist:  http://www.charlessoft.com/
    b)  Jeremy Johnstone's Terminal method:  http://www.jeremyjohnstone.com/blog/2012-03-11-installing-final-cut-pro-studio-2 -0-on-mac-os-x-10-7-lion.html
    Reports on this forum seem to confirm that Final Cut Studio 2 will continue to operate in Mavericks once it is functionally installed, albeit some plug-ins may fail to function.  FCE 3.5 is the same generation as FCS2, and presumably will continue to operate in Mavericks, as well.

  • HT4859 I just got a replacement phone and want to do a restore from Icloud and cant find the back up there.

    I just got a replacement phone and want to do a restore from Icloud and cant find the back up there.
    I purchased extra space and have backed up my ipad and my iphone.  I backed up my iphone this am and again around 3.00pm when I was in the apple store.  I came home to restore the phone and now cant see the back up on icloud.  where did it go and how can I see all of my storage on icloud

    Welcome to the Apple Community.
    settings > general > reset > erase all content and settings, once complete the set up assistant will ask if you have an iCloud back up, follow on screen instruction to restore from it.

  • XSLT mapping not working b'coz " " & " " replaced with and

    Hello Experts,
      I have a RFC to JMS scenario. One of the parameter of RFC is a string field. This field will contain the XML data in it.
    I need to create a complete XML payload using this data in a string field. For this I am using XSLT map :
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
         <xsl:output method="xml" omit-xml-declaration="no"/>
         <xsl:template match="/">
              <xsl:for-each select="//Nem">
                   <xsl:copy-of select="."/>
              </xsl:for-each>
         </xsl:template>
    </xsl:stylesheet>
    This XSLT mapping works fine when tested independently.
    But in actual scenario at runtime the "<" & ">" used to indicate a node are getting replaced with < and >. Then the XSLT mapping fails and produces no output.
    The output of XSL will be passed in to a java mapping which signs the payload digitally.
    What is the issue with these signs? How can I overcome this problem?
    Any inputs will be of great help.
    Kind Regards,
    Abhijeet.
    Edited by: Abhijeet Ambekar on May 4, 2010 2:01 PM

    Hi Stefan,
      Yes - I want to get rid of & # 60. But these (& # 60 and & # 62) are not added by XSLT mapping. Rather they are in the input available to XSLT map.
    In sxmb_moni, i can see the inbound payload correctly :
    <?xml version="1.0" encoding="UTF-8" ?>
    - <rfc:HDK083_REFUS_SENDDOCU xmlns:rfc="urn:sap-com:document:sap:rfc:functions">
      <P_SIGN_DOCUMENT />
      <P_XML_DOCUMENT><NemRefusionIndberetningSamling><NemRefusionIndberetningStruktur MessageID="1"><HeaderStruktur><SignOffIndikator>true</SignOffIndikator><TransaktionKode>Opret</TransaktionKode><IndberetningstypeKode>Anmeldelse</IndberetningstypeKode><FravaerTypeKode>Sygdom</FravaerTypeKode><FravaerendeStruktur><FravaerendeTypeKode>Loenmodtager</FravaerendeTypeKode><LoenUnderFravaerIndikator>false</LoenUnderFravaerIndikator></FravaerendeStruktur><IndberetningUUIDIdentifikator>bf9cc44e-af15-4e19-8457-5845d75385d2</IndberetningUUIDIdentifikator><ReferenceAttributTekst>ref. Nielsen-1503831372 (23. oktober 2009)</ReferenceAttributTekst>
    but when I try to download the payload or right click on payload to view source I get something like below:
    <?xml version="1.0" encoding="UTF-8"?><rfc:HDK083_REFUS_SENDDOCU xmlns:rfc="urn:sap-com:document:sap:rfc:functions"><P_SIGN_DOCUMENT></P_SIGN_DOCUMENT><P_XML_DOCUMENT>& # 6 0;NemRefusionIndberetningSamling& # 62; & # 60;NemRefusionIndberetningStruktur MessageID="1"& #62;& #60;HeaderStruktur& #62;& #60;SignOffIndikator& #62;true& #60;/SignOffIndikator& #62;& #60;TransaktionKode& #62;Opret& #60;/TransaktionKode& #62;& #60;IndberetningstypeKode& #62;Anmeldelse& #60;/IndberetningstypeKode& #62;& #60;FravaerTypeKode& #62;Sygdom& #60;/FravaerTypeKode& #62;& #60;FravaerendeStruktur& #62;& #60;FravaerendeTypeKode& #62;Loenmodtager</FravaerendeTypeKode><LoenUnderFravaerIndikator& #62;false</LoenUnderFravaerIndikator></FravaerendeStruktur& #62;<IndberetningUUIDIdentifikator& #62;bf9cc44e-af15-4e19-8457-5845d75385d2& #60;/IndberetningUUIDIdentifikator& #62;& #60;ReferenceAttributTekst& #62;ref. Nielsen-1503831372 (23. oktober 2009)& #60;/ReferenceAttributTekst& #62;
    (extra spaces added to "& # 60" as browser was converting it to < ,>)
    If i take the source code for payload and test XSLT mapping, it fails. But if I manually replace all "& # 60" with < and "& # 6 2" with >, then the mapping works fine.
    So I think for XSLT map to work correctly, we need to replace all "& # 60 " . Please suggest.
    Kind Regards,
    Abhijeet.

  • I purchased a replacement PC and have not been able to install/activate my Adobe Acrobat 7.0 Professional.  Any suggestions.

    I purchased a replacement PC and have not been able to install/activate my Adobe Acrobat 7.0 Professional.  Any suggestions?

    You need to install a special version using a special serial number... see the following:
    Error: Activation Server Unavailable | CS2, Acrobat 7, Audition 3 -
    http://helpx.adobe.com/x-productkb/policy-pricing/creative-suite-2-activation-end-life.htm l

  • Just received a replacement ipad2 and I pressed start iPad as new by mistake. I wanted to restore my iPad by syncing it with iTunes. Can anyone help with this?

    Just received a replacement ipad2 and I'm having trouble syncing it with my pc. I started my iPad as new instead of using the restoring option, is there any way I can get my old apps, songs etc restored on my replacement iPad?

    You've already set it up as new? Go into the settings and general and reset and reset everything. THen plug it back in and iTunes will, hopefully, see it as new again and you can choose the restore option.

  • I am trying to set up my new replacement phone and the iCloud account is using my old email that is no longer activated, so I am not able to reset my password in order to set up messaging, etc. What do I do??

    I am trying to set up my new replacement phone and the iCloud account is using my old email that is no longer activated, so I am not able to reset my password in order to set up messaging, etc. What do I do??

    Try to change your Apple ID back to your old email address (http://appleid.apple.com) in order to set up and activate the phone. After the set up please sign out of iCloud and turn off "Find My iPhone" (Settings > iCloud) - do that on all your devices -, then change your Apple ID to your new address again and then add your iCloud account on you devices again.

  • IMac (24-inch, Early 2009) Hard Drive Replacement: Hybrid and Maximum Size Question

    I have a 24-inch iMac, early 2009 model and the internal hard drive has died so am looking to replace it and also upgrade it in the process.
    At the moment the broken internal drive was the standard 1TB model that comes with the computer. I have been doing a little bit of research and I'm liking the sound of a hybrid drive as they seem to be a relatively economical was of achieving close to SSD speeds. I've been looking particularly at 'Seagate ST4000DX001 DESKTOP SSHD 4TB SATA 6GB/s NCQ NAND 8GB 64MB HYBRID' for the replacement. I guess my question is if this drive will work in the iMac. Does a hybrid drive present and problems? Also, is there a limit to the maximum size the replacement drive can be? Will 4TB exceed this limit? Lastly, I understand this drive uses SATA III to connect with the computer, which is backwards compatible (I think?) so I'm presuming this will work in my iMac?
    Thanks in advance.

    The hybrid drive will kinda sorta be as fast as an SSD. The newest Seagate Hybrid is quite intelligent about caching the most often used files in flash and is quite an improvement over the first iteration. I used both the first and second generation drives in my 2007 iMac and was quite impressed with their performance…until I installed an SSD. The problem with the hybrids is that they just don’t have enough flash and no matter how intelligent the drive is it is guesswork so sometimes you’ll find the drive access just as pokey as any other 5400 RPM drive and then other times very fast.
    For about $200 it is a decent upgrade but with SSD prices having dropped nearly 50% in the last 18 months it is worth considering a smallish internal SSD for the OS and applications and an external drive for data.

Maybe you are looking for

  • Hard drive crash HELP

    Hard drive crashed - had to reinstall iTunes. Is it possible to download songs from a 20 GB iPod back to the hard drive as a new library or when I plug in will songs on iPod be lost? Rich Sorry no back up. Dell   Windows XP  

  • Download Error. Unable to reach Adobe servers. Please check your internet connectivity, firewall settings, and then try again.(12175)

    I've searched everywhere, deleted those 2 folders in the username/local/adobe directory, and tried turning off my firewall. Unfortunately, I can't even use a live chat room because I'm trying to try it out first so I'm not a pro member yet. Windows 7

  • Staircase edges on DV video

    Just a quick question...whenever I import DV video into Motion, the quality is not quite as good, and the edges on curved sections in the video are "staircased", but the same video in FCP looks great. I have tried changing almost every setting in Mot

  • Provide a font preview

    A simple font preview would seem to be a no-brainer for a company that sells fonts and where the user group by-and-large use fonts intensively. A nice touch would allow the user to customize the sample text phrase. If it's worthwhile to try to sell m

  • Appleworks freezes when attempting to change a data base field

    In a data base I created, trying to change a number in one field will freeze Appleworks. A number can be entered, but any attempt to delete, add to or change the data in that one field causes a freeze. This does not happen in any other field in this