Round and square brackets in regexp

Hello,
Can someone please explain to me what is the difference between:
SELECT REGEXP_INSTR('aoeeeeo','(i|e)o') position FROM dual;
and
SELECT REGEXP_INSTR('aoeeeeo','[ie]o') position FROM dual;
I mean, what is the main difference between round brackets with the alternation operator and square brackets in regular expressions?
Thank you very much,

It will perhaps be clearer if you look at it with more than just single characters...
SQL> select regexp_replace('this is fred and his test string', '(is|and)','XXX') from dual;
REGEXP_REPLACE('THISISFREDANDHISTES
thXXX XXX fred XXX hXXX test string
SQL> select regexp_replace('this is fred and his test string', '[isand]','XXX') from dual;
REGEXP_REPLACE('THISISFREDANDHISTESTSTRING','[ISAND]','XXX')
thXXXXXX XXXXXX freXXX XXXXXXXXX hXXXXXX teXXXt XXXtrXXXXXXg
SQL>The round brackets allow you to specify whole strings whereas the square brackets allow you to specify sets of individual characters.
Therefore in my first example it looks for IS or AND and replaces those.
In the second example it looks for any occurence of the characters I,S,A,N,D and replaces those.

Similar Messages

  • Create shape with round and square corners

    Hi all
    I haven't used illustrator for a while so I'm really stuck on soemthing that should be simple.
    I want to create a shape that has round corners on the bottom and square cormers at the top.
    I have created two shapes, one with round corners and one with square one.
    I was hoping to put them together then use the pathfinder to unite them but this then make the round corner square.
    Is it possible to unite shapes with different corners.

    myttmt,
    Or create a rounded rectangle that is one corner radius too high, press C (Scissors Tool) and cut at the top of the straight sides (first right then left), press V to switch to the Selection Tool and delete the selected top cut, then select the remaining part and Ctrl/Cmd+J to join.
    The bottom rounded rectangle thread lives. Or is it the tanker cross section thread?

  • Sql Query to replace the square bracket and the whole text inside with a single charecter

    Hi All,
    I  have a question.
    I am using Sql Server 2012.
    I have a  situation where i need to replace the entire text and the square bracket with a single charecter.
    Eg:-> 
    I have atext    san[123456dd]text
    i just wanted to replace all teh text inside the sqaure bracket to another charecter say 'X' 
    My end result should be sanXtext.
    Could anyone help me regarding this?
    Samproo

    Prashanth ,
    Thanks 
    It works if i have a single square bracket like 
    'san[123456dd]text'but presently i do have multiple square brackets like'san[123456dd]text[898989dd]note'I wanted to have teh result as 'sanXtextXnote'
    Samproo

  • What are the square brackets around paragraphs and heads?

    I am hoping that someon can hlep me with this topic. I can not seems to find anything on this matter.
    I have recieved an InDesign file for a book that we are updating the design and content for. All the text in this file has Square brackets, at the begining and end, of each paragraph or head. I have never seen this before, coming from a Quark background.
    The characters are visible in "normal mode", but they disapear when you view in "preview" mode.
    Can anyone please tell me what the Square brackets around text means?

    If you are using OSX this AppleScript should remove all of the XML tags, but test it carefully on a copy of the document:
    tell application "Adobe InDesign CS3"
    try
    untag (every XML element of document 1)
    end try
    end tell
    If you are not on a Mac I'm sure you could get the equivalent JavaScript at the scripting forum.

  • Support forum link button adds unnecessary square brackets and vertical line.

    The post editor on this support forum has a button to insert links, giving a result [[https://support.mozilla.org/|like this]] (two sets of square brackets, with | to divide link from text) when it seems that in order to work properly it should be [https://support.mozilla.org/ like this] (one set of square brackets, space to divide link from text).

    That is the correct way to refer to knowledge base articles by using their title.
    Using a complete URL only needs one pair of brackets and a space as separator between the link and the title.
    See:
    *https://support.mozilla.org/en-US/kb/markup-chart
    <pre><nowiki>
    Link to other articles Page Title [[Page Title]]
    Link specific text to other articles click here [[Page Title|click here]]
    Link specific text to anchor in the same article click here [[#w_anchor|click here]]
    Link specific text to anchor in other articles click here [[Page Title#w_anchor|click here]]
    External link http://www.mozilla.com/ [http://www.mozilla.com/]
    External link with text Mozilla [http://www.mozilla.com/ Mozilla]</nowiki></pre>

  • To see if a file has balanced curly braces, square brackets

    I am writing this class (along with other files that are in a package) to insert characters in a linkedlist and to see if the curly braces, square brackets and parentheses are balanced. For example something like this( I need to have line numbers also );
    1. This file is balanced with curly braces, square brackets
    2. and parentheses: {}, [] and (). These
    3. characters are not required to balance inside
    4. quoted strings. E.g., "){[[]".
    Input is balanced.
    I am not doing it right and that is where I need help or a way to lead me to a solution. I am going crazy, I am losing it....any good idea will help.import java.io.*;
    import java.util.StringTokenizer;
    class balance
      public static void main(String arg[])
         Queue word = new Queue();
          int index = 0;
         LinkedList itr = new LinkedList();
         LinkedList size = new LinkedList();
            try
                FileReader fr = new FileReader (arg[0]);
                BufferedReader inFile = new BufferedReader(fr);
                String line = inFile.readLine();
                 while(line != null)
                    line = inFile.readLine();
                       while(size >= line.length() && line.charAt(index) != ' ')
                         Sentence.insert (new Character(line.charAt(index)));
                         index++;
                       while(!Sentence.empty( ))
                                while( itr != null )&& itr.equals( "{" ) || itr.equals( "}"))
                       System.out.print (((Character)Sentence.remove()).charValue());
                       System.out.print ("  ");
                        index++;
                inFile.close();
           catch ( Exception e )
            {  System.out.println( e );  }
          System.exit(0);
    }

    A fairly easy way is to have one counter variable per bracket-set you want to test for balance and count this vairable up each time you meet an opening bracket (outside a qouted string) and down each time you meet a closing bracket (also outside a qouted string)...
    If these counters does not finish with having their initial values (eg. zero) the one set not balanced is the one whose counter variable is not zero (positive for too many opening brackets, negative for too many closing brackets)
    eg.
    int countSquareBrackets = 0;
    int countCurlyBrackets = 0;
    int countParenthesis = 0;
    if (/*not in string*/)
    switch (line.charAt(index)) {
    case '[': ++countSquareBrackets; break;
    case ']': --countSquareBrackets; break;
    case '{': ++countCurlyBrackets; break;
    case '}': --countCurlyBrackets; break;
    case '(': ++countParenthesis; break;
    case ')': --countParenthesis; break;
    Hope it leads you closer to a solution,
    chrh

  • Opening an excel file from a button. square brackets in filename

    Internet explorer 6. Apex 3.1
    When I open an excel file (via a button) , it has the filename as follows:
    production_report[1].csv
    The prompt to save or open has the name as production_report.csv
    This prevents people saving the opened file as square brackets are not allowed in the file name.
    Is this an apex issue (ie a problem with the way I specify the filename) or a browser issue, and is there a solution?
    I am passing the filename in to my excel download page using the items/values settings.
    eg
    ITEM P12_FILENAME
    ITEM VALUE production_report.csv

    Yes, It works on firefox. It is only an issue with Internet Explorer.
    However our web based application has to use IE and therefore when it calls apex it is in an IE browser.
    I am really just producing a csv file, and opening it in excel. If this was fixed (or customisable in some way in IE that would help)

  • How can I read "Keys" from a Config File that have square brackets in them?

    I'm using the "Read Key (String).vi" from the config.llb and I'm having a problem because the key names in my file have square brackets in them. I'm creating an VI to read certain pieces of the TestStand �StationGlobals.ini� file and array elements appear as %[0] = "blah blah blah". It looks like they're not getting recognized at all. Is there a way to handle this?

    I was just looking at the code inside the configuration VIs and the way they work under V6 is that the Open VI actually reads the contents of the configuration file, parses it (in nice-platform independent G) and stores it in a fancy LV2-style global called the "Config Data Registry.vi". The routine that does the parsing is called "String to Config Data.vi". My gut reaction is that this code is going to be the same in your version because between sometime prior to V6 of LV, NI changed the location of a couple terminals on the low-level Match String function and it looks like when this code was originally written the terminals were in the old configuration.
    In any case, if your square-bracket containing strings are getting lost, this is probib
    ly where it's happening at. The other place to check is in the read VI itself. The V6 VI for reading the configuration registry is called "Config Data Get Key Value.vi". It's output is then further parsed by a function called "Parse Store String.vi" if the "read raw string?" input is set to False (the default position).
    Given that all the code for these functions are written in LV, you should be able to fix your VIs to read the strings you have in the ini file now. Which IMHO is actually the way they should work.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Replace square brackets in SQL queries against ODBC

    We use PowerPivot to access an ODBC provider. PowerPivot generates queries with square brackets, which is not ANSI compliant and incompatible with this ODBC provider. In Office 2010, we had a workaround by modifying this file:
    C:\Program Files\Microsoft Analysis Services\AS OLEDB\110\sql2000.xsl
    and replace the '[' and ']' with double quotes.
    !-- SQL Server 2000 pluggable cartridge -->
    <!-- Area of STANDARD parametrizations: these are externally passed -->
    <xsl:param name="in_CanUseParams">yes</xsl:param>
    <xsl:param name="in_IdentStartQuotingCharacter">[</xsl:param>
    <xsl:param name="in_IdentEndQuotingCharacter">]</xsl:param>
    However, this workaround does not seem to work after we upgraded to Office 2013. PowerPivot doesn't appear to read this cartridge file anymore. We are familiar with the option to manually write queries to bypass this issue, but we still like to use the generated
    queries. Is there another way to replace the square brackets?

    I think you could do this:
    Code Snippet
    SELECT
    OUTSIDE
    .OUTSIDE_SALES,
    INSIDE.INSIDE_SALES,
    CUST.CUST_NAME,
    SOE.CUSTOMER_NO,
    SOE.SALE_ORDER_NO,
    SOE.INVOICED_DATE,
    PICKUP.PICKUP,
    (SOE.SALES_AMT/100) AS SALES,
    (SOE.COST_GOODS_SOLD/100) AS COGS,
    (SOE.SALES_AMT/100) - (SOE.COST_GOODS_SOLD/100) AS MARGIN,
    COUNT(TRACKING.PALLET_ID)
    FROM
    SOE_HEADER SOE
    INNER JOIN CUST_NAME CUST
    ON SOE.CUSTOMER_NO = CUST.CUSTOMER_NO
    INNER JOIN INSIDE_SALES INSIDE
    ON SOE.INSIDE_ROUTE = INSIDE.INSIDE_ROUTE
    INNER JOIN OUTSIDE_SALES OUTSIDE
    ON SOE.SALESMAN_NO = OUTSIDE.SALESMAN_NO
    INNER JOIN PICKUP PICKUP
    ON SOE.TYPE_OF_FRGHT = PICKUP.TYPE_OF_FRGHT
    INNER JOIN PALLET_SALES_ORD SALES
    ON SOE.SALE_ORDER_NO = SALES.SALE_ORDER_NO
    INNER JOIN PALLET_TRACKING TRACKING
    ON SALES.PALLET_ID = TRACKING.PALLET_ID
    WHERE
    SOE.TYPE_OF_ORDER = '00'
    AND SOE.ORDERS_STATUS = '06'
    AND SOE.DATE_OF_ORDER > 20080101
    AND SOE.TYPE_OF_FRGHT IN ('06','08','10','13','14')
    AND SOE.CUSTOMER_NO <> '1000027000'
    AND SOE.CUSTOMER_NO <> '1000039000'
    AND SOE.CUSTOMER_NO <> '1014869000'
    AND SOE.CUSTOMER_NO <> '1014869001'
    AND SOE.CUSTOMER_NO <> '1014869002'
    AND SOE.CUSTOMER_NO <> '1014869003'
    AND SOE.CUSTOMER_NO <> '1014889000'
    AND SOE.CUSTOMER_NO <> '1014890000'
    AND SOE.CUSTOMER_NO <> '4400000000'
    AND SOE.CUSTOMER_NO <> '4499998000'
    AND SOE.CUSTOMER_NO <> '4500012000'
    AND SOE.CUSTOMER_NO <> '4500018000'
    AND SOE.CUSTOMER_NO <> '6900002000'
    AND CUST.CUST_NAME NOT LIKE '%PETCO%'
    GROUP BY
    OUTSIDE
    .OUTSIDE_SALES,
    INSIDE.INSIDE_SALES,
    CUST.CUST_NAME,
    SOE.CUSTOMER_NO,
    SOE.SALE_ORDER_NO,
    SOE.INVOICED_DATE,
    PICKUP.PICKUP,
    (SOE.SALES_AMT/100),
    (SOE.COST_GOODS_SOLD/100),
    (SOE.SALES_AMT/100) - (SOE.COST_GOODS_SOLD/100)
    ORDER BY
    OUTSIDE
    .OUTSIDE_SALES,
    CUST.CUST_NAME,
    SOE.INVOICED_DATE,
    SOE.TYPE_OF_FRGHT
    Another option would be to encapsulate the second query in a scalar UDF (if using SQL2k or greater) which would get the count for each sales order and then just return this in your select statement.
    HTH!

  • Square brackets around name of pdf preset

    Hey folks, I have custom pdf presets that are used to output PDFs from Adobe InDesign CS3 on the Windows OS. These presets are in the usual default folder: C:\Documents and Settings\All Users\Application Data\Adobe\Adobe PDF\Settings\ and are included with a bunch of the default settings. At any rate, when I open InDesign and choose Adobe PDF Presets from the File menu, all of the settings are visible. However, they all have square brackets around the name, [myCustomIDPDFPreset]. I expect this result from the default job options that ship with Adobe but not in my custom presets. This is an issue because our output scripts use the specific name of the preset to output PDF content so the inclusion of the square brackets causes it to fail. Any thoughts on how the custom presets can appear in the list without square brackets. This was how it worked in CS2. Thks, Wil

    Here is a screen shot of what's in my ID CS4 PDF Export options. All have brackets.
    Here's what a search for "joboptions" returns. I'm on Intel iMac running 10.5.8. CS4.

  • Matching substrings between square brackets using regular expressions

    Hello,
    I am new at Java and have a problem with regular expressions. Let me describe the issue in 3 steps:
    1.- I have an english sentence. Some words of the sentence stand between square brackets, for example "I [eat] and [sleep]"
    2- I would like to match strings that are in square brackets using regular expressions (java.util.regex.*;) and here is the code I have written for the task
    +Pattern findStringinSquareBrackets = Pattern.compile("\\[.*\\]");+
    +     Matcher matcherOfWordInSquareBrackets = findStringinSquareBrackets.matcher("I [eat] and [sleep]");+
    +//Iteration in the string+
    +          while ( matcherOfWordInSquareBrackets.find() )+
    +{+
    +          System.out.println("Patter found! :"+ outputField.getText().substring(matcherOfWordInSquareBrackets.start(), matcherOfWordInSquareBrackets.end())+"");     +
    +          }+
    3- the result I have after running the code described in 2 is the following: *Patter found!: [eat] and [sleep]*
    That is to say that not only words between square brackets are found but also the substring "and". And this is not what I want.
    What I would like to have as a result is:
    *Patter found!: [eat]*
    *Patter found!: [sleep]*
    That is to say I want to match only the words between the square brackets and nothing else.
    Does somebody know how to do this? Any help would be great.
    Best regards,
    Abou

    You can find the words by looping through the sentence and then return the substring within the indexes.
    int start=0;
    int end=0;
    for(int i=0; i<string.length(); i++)
       if(string.substring(i,i+1).equals("[");
      start=i;
    if(start!=0)
    if(string.substring(i,i+1).equlas("]");
    end=i;
    return string.substring(start,end+1);
    }something like that. This code will only find the firt word however. I do not know much about regex so I cannot help anymore.
    Edited by: elasolova on Jun 16, 2009 6:45 AM
    Edited by: elasolova on Jun 16, 2009 6:46 AM

  • Smartform square brackets or check box

    Hi all,
             Please help me in the issue . I output of the smartform should have checkboxes or square brackets . I tried using standard symbols but i didnt acheive it . can anyone please sugguest me how can i acheive .
    thanks in advance,

    Hi,
    If the check bax you are expecting is for interactive purpose, then you need to go for adobe forms. If it is just for showing in the layout then you can try below 2 ways.
    1. Upload an image of the check box to your SAP system from SE78. Print this graphic as you normally print the LOGO. ( you can create a node of type graphic)
    2. Create a text element and print a single dot. Set the output options of the text element as below.
    Select check box "Lines with" under the frames section. Give the appropriate spacing and width say 1 PT each. Now it shows a small box with the frames. If it is in main window, then you may need to create a template for controlling the width and hight of the element.
    Thanks,
    Vinod.

  • Make a hole & round a square psd

    I've search for hours and give up.
    How do I make a transparent hole in CS6? I've tried the ellipse tool>stroke>blend opacity to 0, but that just clears the gray circle. It does not create a clear hole.
    Just so you know, I have a square psd in a file with numerous other layers and I want to make it round and put a transparent circle in the center to make a DVD label. That's what I'm after and I can't believe I forgot how to do this.
    Thx everyone.
    Paul

    Paul,
    There are a couple of ways to do that, depending on your Layers.
    Basically, create you ~ 25 - 43mm (depends on the hub design of your disc) Circle (Elliptical Marquee Tool, constrained to Center & Circle with the Alt & Shift keys - I would also do perpendicular Guides for the exact center of the Image). You now have your Circular Selection. Hit Ctrl+Shift+I to Invert that Selection. Here, I would Save Selection. Then, with that Inverted Selection active, create a Layer Mask.  If you have Layers stacked in that area, just repeat the process for each. That is why we Saved that Selection, though you could get it back with other techniques. Before you do that, you might ask yourself about those other Layers. Personally, I would first Save that Layered PSD, then Flatten, so you only "punch" one hole, but that is your choice.
    For the outter knockout, just repeat the process, but with a larger Circle. Note: many printers do not require that outer circles, as they will limit the ink coverage to just the DVD/CD, but I like to clean things up, as few DVD's/CD's allow printing to 100% of the diameter, and there is no sense possibly spreading some ink on the tiny area outside of the printable surface. It just depends on your printer, and its driver.
    Good luck,
    Hunt

  • Can't highlight square brackets

    I've recently bought an iPad air (not air 2). Before that I used an iPad 2 running on iOS 6. I have a document in Dropbox I often copied some specific code from including square brackets. Now, on my new iPad running the newest iOS 8, I'm unable to copy or highlight the starting square brackets. No matter how close I zoom in I can't highlight the very first bracket and any other starting brackets '[' disappear when I paste the text. The closing brackets are still there. Does anyone know why this is happening at what I can do to make it stop? It worked just fine on my old iPad and I would be very disappointed if my new iPad can't do something that simple.
    Thanks, Zebrakatten

    Just had the same problem with a german keyboard,
    y was z and z was y.
    Try to search 'Editing a Locale' in the IDE Help, you have to specify the language for the project, you're currently working on.
    It's quite good explained and worked after a relaunch of SJSE (nice job, SUN)

  • Where's the square bracket key?

    Hey guys. I'm using a Dutch azerty keyboard and I can't find the square bracket keys. I need 'em badly for programming. How can I type them?

    I don't see a Dutch azerty keyboard layout - the Dutch layout is qwerty and the square brackets are to the right of the p key.
    However, for the Belgian layout, which is azerty, [ is Shift-Option-5 and ] is Shift-Option-- (Shift-Option-Hyphen).
    You can hunt for keys yourself (do you remember the Classic utility KeyCaps?)- go to System Preferences > International > Input Menu tab and check the box for Keyboard Viewer. A flag should appear in your menu bar (if not, scroll down to your language and check the box there). Click on the flag in the menu bar and select Show Keyboard Viewer. A mini keyboard will appear, and you can hold down Shift, Option, Ctrl, or any combinations of them and the keys will show you what you get.
    Hope this solves your problem...

Maybe you are looking for

  • How to restore messages written/received by an old account

    I have a user which created a new Account in Mail Preferences, and then removed the old one. Guess what, Mail decided to destroy the associated POP folder in user/Library/Mail/, and all messages in Inbox and Sent mailboxes belonging to this old email

  • Error message "ImporterProcessServer.exe has stopped working"

    I imported DVD files into CS4 as MPEG2s as when I converted the DVD footage received from a client as avi files they totaled almost 300 Gigs! and that was only for 5 short DVDs of horse show footage. Anyway, imported one of the mpgs and cut out foota

  • .Mac Web Gallery crashes Safari

    I am replacing our old iWeb photo pages with a .Mac Web Gallery. I've got 63 Albums that I've turned into galleries. When I try to load the main gallery page I get this error from Safari: *A script on the page ".Mac Web Gallery -" ( http://gallery.ma

  • Ipod 5th not syncing.

    My brand new ipod touch 5th keeps getting stuck on 'waiting to sync'. It's IOS 7.0.4, iTunes 11.1.3.8 and Windows 8.1 I've tried uninstalling and reinstalling iTunes and everything else Apple on my PC. Resetting and Restoring the ipod to factory sett

  • Adcmctl.sh very slow on R12

    Hi, adcmctl.sh command takes a lot of time to bring down the concurrent services in R12 env compared to 11i version. I can understand this if we have brought down the services when any concurrent requests are still running , but this happens even whe