REGEXP_COUNT on the string containing * or /.

Hi all

When I run the slot request, it should return 6 but it is other than 6 back.

Same query is executed by replacing ' |' with ' *' and other than 6 obseverd.


Version DB: oracle 11.1.2.1

can someone please explain why it is like that.
SELECT REGEXP_COUNT('|us|uk|jp|ab|in|', '|', 1) REGEXP_COUNT
   FROM DUAL;
Thank you.

Published by: DS 17 Sep, 2012 06:54

You must escape from the pipe, because it's a special regular expression operator.

SQL> SELECT REGEXP_COUNT('|us|uk|jp|ab|in|', '\|', 1) REGEXP_COUNT   FROM DUAL;

REGEXP_COUNT
------------
           6

Tags: Database

Similar Questions

  • Test whether the string contains the only slash the other way around?

    Hello

    How do you do that?

    I need to check if

    (a) the string contains two consecutive backslashes

    (b), if not, check if there is at least an oblique bar opposite

    If (test.) IndexOf("\\") > = 0) seems to knock on a string that is 'ss\\ss', but I have a feeling that is incorrect. I think it's really just test for 1 backslash.

    AS3 and don't let you do if (test.indexOf("\") > = 0), as the single backslash escapes the rest of your code.

    It is to test for the existence of a or two backslashes in the ID3 tags, as some editors use as a delimiter for multiple tags within the category of a tag for example kind: rock\\pop, or rock\pop

    Thanks for taking a peek.

    {if(s.IndexOf("\\\")>-1})

    There are two or more backslashes consecutive

    } else {if(s.indexOf("\\")>-1)

    There is that a single backslash

    }

  • validate the string contains a _ using an if statement

    Hello

    I have a project that returns a serial number. I just need to validate that the serial number has a _ "underscore".

    Can anyone provide a sample if statement that returns a bollean if the string is a ____.

    Thank you

    var myString:String = "string_with_underscore";

    validate the var: Boolean = myString.indexOf ("_") >-1;

  • Is there a way to differentiate the string containing the characters and numbers?

    Hello, I created an application to read data from a serial port device. The problem is that the device, at startup, displays a block of text that contain characters describing the device. Shortly after, he displays a command prompt "command:" it's when I want my VI to enter the command to start to take action.

    I was looking at the VISA waiting on the event and looks that could be used to wait for the output device, only a "Serial character", but there is no distinction between the letters and numbers that I can tell.

    If the device is out of numbers in the reading string, of course, no need to enter the command to start to take action once again, which will probably only confuse the device. In this case, I want my VI to continue taking measures with VISA Read.

    The reason is that when I run the application, the device may have already been turned on. Send this command to the device using VISA Write is not necessary at this time.

    Any advice would be appreciated. Thank you.

    This makes it much easier.  In this case, this will do the trick.  You will notice that the bottom of the case does not match even if it has valid values inside.  The only thing that will match if the entire string is of the form XX. XXXX. Incidentally, since we are only matching numbers now, you can remove the "ignore case" Boolean as there is more important.

  • How to convert the Ascii string containing hex to hex string info?

    Dear all,

    I am busy doing a control/reading program for pumps of ISCO.

    Right now I'm in trouble with to send orders for PUMPS in HEXADECIMAL. When I use a CONTROL to the STRING in HEX display, everything works fine (when I manually write down the command in the control of the chain).

    Exist it a couple of pieces order: string Destination, length, ordering, Checksum. I'm doing a sup - screw that automatically calculates the checksum (modulo 256) and adds it to the string. Everything is going well: first of all, I shared the ascii bytes command and I calculate the checksum and add as ASCII HEXADECIMAL value to the chain of command. Also a CR (= 0d) is added. Now the whole string must be converted to hex. The string contains the right nummers HEX, but they are in ASCII format. Here was I feel worth it, I don't know how to do it!

    So to summarize:

    I have an ascii string that contains the values HEX (for example 315230303652454D4F544531420D) and it must be converted to a HEX string (for instance 3152 3030 3652 454 4531 420 4F54) for the pump of the ISCO can understand the command.

    The VI is attached.

    Thank you in advance,

    Bio

    Bio,.

    This should do what you want.

  • Check that a string contains data only numbers

    Hello

    I'm trying to find an elegant way to test an input string "serial number" format A00000000 (where A can be any letter and 0 can be a number any).  My first thought was to check the following features:

    (1) total string length = 9.

    (2) using the "Decimal String to the Number.vi", result = 0 (which indicates that the string contains no numbers).

    (3) using the 'Decimal string to Number.vi' with an offset of 1, the result is a number.

    Unfortunately, that does not differentiate between the following strings:

    A00005123 valid

    Invalid A5123

    Invalid A5123B123

    Invalid A005123BC

    All the world is this recently?  Is there a way to analyze non-specific chips (for example separating the groups of letters, numbers or other?)  Is there a complete way to do this without breaking the chain in 9 individual items and do a comparison of 26 item for the letter and 10 element for each number comparisons?

    Thank you

    Sean

    You can use a regular expression to match the pattern.

  • REGEXP_REPLACE problem with special characters in the string

    Hi guys,.

    I have had problems using the REGEXP_REPLACE function and I'm trying to find a solution.

    The closest I can get is this thread:

    Re: How to replace the first occurrence of a substring

    and that's only because the solution, I'm trying to achieve is the one suggested. I did ppost my problem there, but because it is answered, I don't have an answer.

    I'm doing the following:
    select 
      regexp_replace('A*|A*|C11|A1|A*||_|OR|H452|C40|A|A*||_|AA|1151|G31|A1|A||_|EX|8HI01|H11|A1|A||_|OCR|H421|B11|A|||_|OR|H434|C11|A|||_|AQA|9990|E10|EP|||_|AA|2151|G31|A|||_|',
      '^(\w|-)*\|{1}',null)
    from dual
    Basically, replace it does not work, because the first part of the string contains an asterisk. If you delete the Asterix, then replace it won't work.

    How can I get around this? I can't use a regular REPLACEMENT as I want to remove the first instance of A * and not all instances of the A.

    Help, please! I don't know what to do... probably, I mustn't start a loop through the string?

    Thanks in advance guys!

    Robin

    User_resU wrote:
    I want to remove the first instance of A * and not all instances of the A.

    To decode your regular expression, it seems that you want to remove A * | and not just A *.

    SQL> select   regexp_replace('A*|A*|C11|A1|A*||_|OR|H452|C40|A|A*||_|AA|1151|G31
    |A1|A||_|EX|8HI01|H11|A1|A||_|OCR|H421|B11|A|||_|OR|H434|C11|A|||_|AQA|9990|E10|
    EP|||_|AA|2151|G31|A|||_|',
      2    '^(\w|-)\*\|{1}',null) reg
      3  from dual;
    
    REG
    --------------------------------------------------------------------------------
    
    A*|C11|A1|A*||_|OR|H452|C40|A|A*||_|AA|1151|G31|A1|A||_|EX|8HI01|H11|A1|A||_|OCR
    
    |H421|B11|A|||_|OR|H434|C11|A|||_|AQA|9990|E10|EP|||_|AA|2151|G31|A|||_|
    
  • Bug: Find/replace does not work if the statement contains the string is too long

    Hello

    in my sequence, I press Ctrl + F to open the Find dialog box and enter a string. All the checkboxes are checked 'Elements for search' and ' limit the search to "is not enabled.

    Now comes the finding it is only announcing the discovery in the main sequence.

    Other places in a sous-suite that are part of a labview vi action setting is not in the list. Also if I open the sequence and I'm looking at this place.

    If I create a comment in the subsequence containing the searchstring, then it is.

    When I open the properties of the action of labview and open the parameter that contains the string and click on check for errors, and then close all and supplementary search then the value lies.

    Is it possible that the variable is too long setting? It's about 200 characters and one thing very nested SationGlobals and the table and the TestSockets. Search string Dees is finally an arrayindex in this grand statement.

    It seems that this is the problem.

    Is this a known bug?

    Solved.

    There was an empty character at the end of the search string...

  • Is there a way to parse a string containing % (percentage symbols) using the function 'analysis of the chain?

    I am communication in series with a mirror device and the syntax of the input string contains this text: "% hr ="

    I was not able to find a way to say to the function that the percentage here is not a format specifier. Is it possible, or should I just try to use a different function?

    Thank you.

    Use %% in your format string for what he knows to use the percent literally.  So % RH = %f

    EDIT: Darin has one here in front of me.  It seems to be-% and % both work.

  • Order findstr/l/s/m print the file names of all the files in the directories and subdirectories despite any string contained

    Hello

    I'm looking for a file via the findstr command. After that I opened the command as Administrator window, I get:

    Findstr/l/s/m 'a string containing the words. " *

    Then, the command window displays all the files in the directory and its subdirectories. I think that I see which file is searched for the chain in real time.

    I expected to see only the name of the file/s if the string was found in it.

    What I am doing wrong? or why is this malcfunctionaning?

    I got directions for ordering findstr here: https://technet.microsoft.com/en-us/library/bb490907.aspx

    Thank you

    I think you want the /c parameter instead a / l.  As written, your search string is interpreted as a list of strings: 'a', 'string', 'with' and 'words '.  Any file that contains an 'a' will be a return match.  The parameter/l keeps your strings to be interpreted as regular expressions.

    If you need exactly match to the entire chain, type:

    Findstr /s/m/c: "a string containing the words." *

    Under the direction of add: It is not clear, but you can have several settings/c , to search for more than one exact string at a time.  For example:

    / s/m/c: 'a string' findstr / c: "a Word." *

    Research is 'a string' or 'a word' exactly.

  • Check if a string contains "text" in a box, and only if it does not, add it to the chain.

    I have some comboboxes. I want a text field to add a channel to itself, that contains the text selected in each combobox. I got it with this:

    var a = this.getField ("CoBi_text");

    for (i = 1; i < 16; i ++) {}

    var t = (this.getField("CoB_"+i).valueAsString);

    Si (t ! = « ») {}

    a.Value += t + ',';   }   }

    But what adds text even though I select the same option in any of the combobox control. How can I include a conditional don't skip the increment if "the text is already in the string?  I tried this:

    If ((t! = «») & & (a.value.indexOf ("t") < 0)) {}

    a.Value += t + ',' ;}

    But it causes the chain add the text first, don't increment not any text more after that.

    PS. This text field will be hidden and later used on another condition (if it contains 'a specific text'), some other triggering actions.
    So the ',' (comma) is probably not necessary, but I think that it should not be in the way of a proper search indexOf (right?)

    Thank you.

    eHRM, nevermind. I got it.

    the "t" inside indexOf should not "s...".

    var a = this.getField ("CoBi_text");

    for (i = 1; i<16;i++)>

    var t = (this.getField("CoB_"+i).valueAsString);

    If ((t! = «») & (a.value.indexOf (t))<0) )="">

    a.Value += t + ',' ;}

    Now, he adds "text", but not more than once for each different text on each drop-down list.

    There is always the question of the modification of a selected item in a combobox control, how do I remove the old text from the text box but I think than any forced recalculation should be enough.

    Thank you for taking the time to respond and for the link!

  • How to get a paragraph that contains the string selected in FDK?

    Hello

    I am writing a program that extracts content of the paragraph that contains a selection string. This program runs in the interaction point menu. When the user click on the menu item. The process as follows:
    1. find a chain on a document, for example: F_ApiFind ("ABC").
    2. the F_ApiFind ("ABC") API returns the F_TextRangeT structure.
    3. the string "ABC" has been highlighted on the document.

    Here's my question:
    How can I write code to locate an object ID paragraph (pgfId) that contains the string (or object) 'ABC '?.
    As the 'ABC' object belongs to the current paragraph, how can I get section ID (pgfId) and then get the content of the entire paragraph
    without a loop through FP_FirstFlowInDoc, FP_FirstTextFrameInFlow, FP_FirstPgf and FP_NextPgfInFlow.

    Thank you very much for you help,

    Thai Nguyen

    Hi thai,

    Paragraph ID is returned as part of the structure of F_TextRangeT, as the Member "objId". Let's say you have:

    F_TextRangeT tr;

    ... then:

    TR = F_ApiFind (...);

    On an action to search with success, "tr" will contain the pgfId of the paragraph. I'm assuming you're looking for a string that is entirely contained in a paragraph, in which case two ways contains the ID of the paragraph:

    tr.beg.objId

    TR.end objId

    If you want to retrieve all the text in the paragraph after the search, you could do something like: (attention, incomplete code!)

    F_TextItemsT ti;

    F_TextRangeT tr;

    F_ObjHandleT docId.

    ...

    TR = F_ApiFind (...);

    TR. Beg.offset = 0;

    TR.end.Offset = FV_OBJ_END_OFFSET;

    TI = F_ApiGetTextForRange (docId, & b, FTI_String);

    .. After that the text of the paragraph will be included in the ti TextItems structure. Navigate through this structure can be difficult and I will renounce any discussion about it for now unless you need more help. There is good information in the developer reference as to its use.

    Russ

  • EXCEL ActiveX + error '-2146827284' (but not the string length limit)

    Hi all

    First of all thanks for your help!

    I have a strange error with excel activeX: "-2146827284!"

    Why strange? Because my export feature works perfectly on a computer but not on another... (both are windows 7 + Excel 2007)

    How my application works:

    I have to read an excel spreadsheet which preserves made with different types of instruments of measures.

    For each type of instrument, I have to create a specific worksheet with its measures.

    For example:

    1 spreadsheet excel with the many measures of 4 different types of instruments

    SHOULD GIVE

    4 excel spreadsheets containing the measures of each instrument (1 worksheet for a type of instrument).

    Hope I am clear...

    Why I do with LV? Because it's fun!

    Now that some snapshoot.

    1 - where the bug appears :

    2 - the message I get (translated from french to English):

    Additional information:

    -The size of the string I have write in excel cells is 6 characters max. More I put a condition to return an error if the string length is > 900 characters.

    Thanks a lot for your help!

    SO simple...

    It was just the name of the folder...

    I coded the name of the folder as a constant aim dev. And I do not mind that the name of the folder is not the same on both computers!

    "a missing letter = a week closed.

    Arrrgh

    all sorry to bother you

  • flatten channel adds the length of the string

    Hi all

    I flatten a cluster chain help to flatten to string.vi. The cluster contains strings and arrays. The flattened string contains the length of the string that is appended to the string.

    So if I have a cluster with only 1 string and a value = "LabVIEW". the flattened string would be "0007LabVIEW". Flatten channel vi has a Boolean entry "add string or array of size? even if I set the Boolean value false, it always adds the length of the string. Is this a bug?

    I think that if you read the detailed help to flatten it to string function you will see this is not a bug.  That boolean applies only to top-level data, once put you something in a cluster or array, the Paris are open.

  • Set the string for LabView dll parameter

    Hello

    I created a simple vi LV 2010 (departure vi), which reads the identification of an oscilloscope. Then I take this vi and incorporate it into a dll of LabView. I have test the dll calling LabView (RunFrom dll). Basically, it seems to work, but len and ReadBuffer back empty. It must be in the way I'm configuration configuring the setting for Readbuffer (settings) in the configuration of the dll. I tried several different configurations, but nothing seems to work. Any help is appreciated!

    What is the parameter len?  Normally, you should only set the length of the string, but it seems that you did not do this.  Also, you're passing len by value, and not by reference, so the function is expecting her to be a starter and you will never get return a different value to any value that you provide.

    Do not use a local variable of the ReadBuffer for entry "readbuffer".  You must pass a string initialized long enough to contain the expected quantity of data.  The best way to proceed is to use the array to initialize to create a table of U8, then use the array of bytes to a string.  Set the parameter 'minimum size' to 'len' then run through the length of the string initialized (this is not mandatory but is recommended).  If you need the length obtained output, add another indicator and another parameter to this value.  There might be a way to do it with one by len parameter passing by reference, you need to experiment (it is certainly feasible in C but I don't know if allows him to LabVIEW).

Maybe you are looking for

  • Fitness by using disk recovery on Satellite M70-169

    Hello I have a Satellite M70-169. According to me, I have messed around a bit with software such as cleaners of register etc. and want to make a new start. Exactly how, step by step, using the recovery disk came with the laptop? It will reinstall all

  • Avoid Teststand popup on DST switch

    Hello dear Teststanders :-), whenever the time switch to daylight savings, our testers running for a long time complain that the sequence has been changed and it cannot be recharged because running is running. It's pretty boring. Although the tests a

  • Try to clear a space on my Toshiba laptop, was not sure that the programs, applications or installed downloads I could delete

    I try to clear up some space on my laptop and wasn't sure what programs, or installed applications downloads I could remove.  I use also to be able to lock my computer when I take a step away but the only option that I am able to find is to sleep or

  • Factory reset - what is reset?

    Hello! I was wondering that when after a factory reset, is it really a "factory reset"?  The reason why I asked is because I set the background to something other than a background of motorola and did a reset.  The phone resets, showed a cloth with a

  • How to clear the read setting preferred

    HelloI hope someone can advise me how to remove the read setting preferred in ASM 11.2.0.3?I'm trying to set an empty string, but it gives me an error.Thank you!SQL > alter system set asm_preferred_read_failure_groups = "sid = '+ ASM3;ALTER system se