Regular Expression, problem when the literals have content "I_"

Hi,
I guess this seems to be an Oracle bug/defect. If I am doing it wrongly, please let me know.
I need to remove the "_VERSION" which comes at the last of a string column. For e.g, If the string is WINDOWS_XP_VERSION, then the output should be WINDOWS_XP.
But if you run the below query,
SELECT
REGEXP_SUBSTR('AA_TEST_3_XI_VERSION', '\w+[^_VERSION]') t1,
REGEXP_SUBSTR('AA_TEST_3_Xi_VERSION', '\w+[^_VERSION]') t2,
REGEXP_SUBSTR('AA_TEST_3_XIA_VERSION', '\w+[^_VERSION]') t3
FROM DUAL;
T1 T2 T3
AA_TEST_3_X AA_TEST_3_Xi AA_TEST_3_XIA
1 rows selected
It seems the issue exists only when I use "I_" and works fine with "i_". I checked with few other characters and it all worked fine.
Any ideas? I am using 11g.
Thanks,
Sharmin

Folks,
Thanks for all your helps.
MichaelS, REGEXO_SUBSTR (str, '(\w+)_VERSION$',1,1,null,1) works, but if any string which does not have "_VERSION", it would return NULL. Also, I had used'$' in my expression and missed to put it in the forum. I am sorry not to make it clear that my column can/cannot end with "_VERSION".
hm, Thank you for making me understand how the regexp works. I thought if you do a '^' and supply a word, it would be considered together.
What needs to be done for making negation for a specific word?
WhiteHat,
REGEXP_REPLACE is a better option. But in this case, it helps me the same way with the regular REPLACE function as my column will not contain any other '_VERSION' substring.
I am going to use a regular replace function. select REPLACE('AA_TEST_3_XE_VERSION_VERSION','_VERSION','') substring from dual;
Thanks once again for all your helps.
Thanks,
Sharmin

Similar Messages

  • If i purchase a device through this official website,then how can i send warranty when the device have problem?

    if i purchase a device through this official website,then how can i send warranty when the device have problem?

    To purchase a device from the online US Apple Store you will need a US credit card with a valid US address and a valid US address to ship to. You cannot use a shipping forwarder.
    If you are in a different country you would have to return to the US to access your warranty.
    If you are in the US but not near an Apple Store you would start here for service: https://selfsolve.apple.com/agreementWarrantyDynamic.do

  • My Mac pro tower has an "ATI Radion hd 2600 XT" video card, and it stopped getting signal to my tv, are there common problems known? How can I troubleshoot this problem when the signal isn't reaching the screen?

    My Mac pro tower has an "ATI Radion hd 2600 XT" video card, and it stopped getting signal to my tv, are there common problems known? How can I troubleshoot this problem when the signal isn't reaching the screen?

    http://discussions.info.apple.com/thread.jspa?messageID=12248238&#12248238
    http://discussions.apple.com/thread.jspa?threadID=2649035&tstart=0

  • Does anyone when listening with headphones have problems when the headphones are unplugged?

    I like to listen to music while I run. I currently have the iphone 4S. However, I had the same problem when I had the iphone 4. After I run, I would unplug my headphones and the phone would sense that I still had the headphones plugged in. I should be able to run with the phone and not have this problem. Has this happened to anyone else?

        bmckaige, music is so relaxing while exercising. When connected to headphones, music, incoming calls and alerts will come through in the headphones. Once you remove the headphones from the input on your device, the music will toggle to speaker. For device support, click http://bit.ly/y5iuoj
    Lasina_VZW
    Follow us on Twitter @VZWSupport

  • Simple regular expression problem

    Hello,
    I need help with regular expressions. I have a situation when I need to get data from one table to another and I think my problem can be solved using REG EXP, but I don't know how to use them properly.
    I need to seperate varchar2 fileld whcih is basically number/number into 2 seperate number fields
    CREATE TABLE tst (CODE VARCHAR2(10));
    INSERT INTO tst VALUES('10/15');
    INSERT INTO tst VALUES('13/12');
    INSERT INTO tst VALUES('30');
    INSERT INTO tst VALUES('15');
    CREATE TABLE tst2 (po NUMBER, co NUMBER); I need to get code into co and po columns. I think result should look something like this, but:
    INSERT INTO tst2
    SELECT regexp_substr(CODE 'something here to get the number before /') AS po,
           regexpr_substr(CODE 'something here to get number after') AS co
    FROM tst;   Any help appreciated

    Hi Blu,
    Yes, I have tested with "0" in the figure (like 10/20 30/40). And it worked that time and then I replied. :) :)
    But Still it has a problem in pattern and rectified it below.
    Like :-
    SQL> select regexp_substr('10/40','[^/][0 9]',1,2) DD from dual;
    DD
    40
    But if I (The way you test) use a non zero value like 43 ; below query will not return 43.
    SQL> select regexp_substr('15/43','[^/][0 9]',1,2) DD from dual;
    DD
    My pattern has a slight mistake("-" missing between 0 and 9) and I changed and retested . Correct pattern - '[^/][0-9]' and now it will return 43..
    SQL> select regexp_substr('15/43','[^/][0-9]',1,2) dd from dual ;
    DD
    43this '[^/]+' pattern also works fine.
    Thank you for pointing out Blu; as I came to know lot more about patterns.
    Regards,
    Ashutosh

  • Regular Expressions - Problem

    Hi @ all,
    I need a complicate regular expression, I don´t know.
    I have a big folder with many .htm pages (800-1000) and I have to do the following:
    http://www.domain.de/ab%32-xyz?myshop=123
    I have to delete the "ab%32-xyz", the problem is, that in this are, there could be every symbol, letter or number.
    So the area between "http://www.domain.de/" and "?myshop=123" (these 2 areas are everytime identical in all documents) shoud be deleted.
    Could everyone say me, how to do this with regular expressions in dreamweaver?
    Thanks,
    Felix
    P.S.: Sorry, my Engish is not so good, I´m from Germany

    Do you want to replace the random text with anything?
    If not, this is how you do it in DW:
    Make a backup of the folder you want to edit, just in case anything goes wrong
    Edit > Find and Replace
    In the Find and Replace dialog box, select Folder from the "Find in" drop-down menu, and select the folder you want to work with.
    Select Source Code from the Search drop-down menu.
    Put the following code in the Find text area:
    (http://www\.domain\.de/)[^?]+(\?myshop=123)
    Put the following code in the Replace text area:
    $1$2
    In Options, select the "Use regular expression" check box.
    Click Replace All. Dreamweaver will warn you that the operation cannot be undone in pages that aren't currently open. As long as you have made a backup, click OK to perform the operation.

  • Interesting Regular Expression Problem

    Hi - I am fairly new to Java, but have some reg exp experience.
    Basically, I would like a regular expression to strip elements out of a text format. The elements are delimited by curly braces, very similar to Java. The problem is that the elements may contain other elements - the format is hierarchical. I need to extract the whole element, including its children.
    For example, I need to extract the B element from
    [A]
    a1     1
    a2     2
    b1     1
    b2     2
    [C]{
    c1     1
    c2     2}
    [C]{
    c1     3
    c2     4}}
    and the answer should be
    b1     1
    b2     2
    [C]{
    c1     1
    c2     2}
    [C]{
    c1     3
    c2     4}}
    The nature of the format is not fixed - I won't know how many child elements the B element contains.
    Can this be done using regular expressions, or do I have to write a custom string handling function?
    Thanks for any help.
    Mark

    :-) And I still don't understand it!It's quite easy though ;-) Suppose a word w is generated by some grammar.
    If this grammar is regular you can write word w as xyz where y is not the empty
    word and |x| < p. if w is generated by a regular grammar then xy^nz
    (n occurrences of y) can also be generated by the same grammar. That's
    the 'pumping' giggle part.
    Now suppose the language of nested parentheses is a regular language.
    All you have to do is find a word w = xyz where xy^nz is not part of the language.
    Let w= ((())) and x= ((, y= ( and z= ))), obviously xy^nz is not a properly nested
    parentheses word for n > 1. Note that every generated word in that language,
    long enough has to have that value p, where xy^nz |x| < p and xy^nz in the language.
    The pumping lemma giggle for context free languages is almost the same:
    you have to find two positions where the pumping fails/succeeds.
    kind regards,
    Jos (huhuh, he said 'pumping' ;-)

  • Strange regular expression difference when using an URL

    Hello all,
    I took some time and finally was able to come up with a regular expression that express the condition of a parameter in a URL. Baiscally, I want to remove the parameter and everything that belongs to this parameter in the URL so I can construct another link free from this parameter.
    I want it to match either a number(todeletetable=10) or a list of numbers seperated with a comma (todeletetable=10,11,12,13,) in the URL
    I used the following pattern :
    Pattern.compile("&todeletetable=(\\d+,)+&|&todeletetable=\\d+&");When testing this locally, it works very well.
    String toMatch = "method=allocate&todeletetable=153622,153623,153579,&sortDirection=asc"
    matcher.replaceAll("&") -> returns "method=allocate&sortDirection=asc"However, when playing with HTML links, the comma is encoded into %2C. Therefore, I added this expression to the pattern :
    Pattern.compile("&todeletetable=(\\d+,)+&|&todeletetable=(\\d+%2C)+&|&todeletetable=\\d+&");
    String toMatch = "method=allocate&todeletetable=153622%2C153623%2C153579%2C&sortDirection=asc"
    matcher.replaceAll("&") ->returns "method=allocate&sortDirection=asc" locally but over the web, I get "method=allocate&%2C153623%2C153579%2C&sortDirection=asc"It seems that the %2C is not detected in the regular expression in the case of an URL. I don't know what to do to avoid this.
    Please help me if you can with any hint or solution.
    Thank you
    Raphas

    Use your original pattern but URL decode the URL first using class URLDecoder.
    P.S. I have not checked your regex BUT it looks over complicated.

  • Airport Express Problems when using Apple 27 " cinema display with Macbook

    I have recently got an apple cinema 27" display and when I connect it to my macbook and wake the computer up I cannot connect to the airport network. I can connect to wlan-ap, whatever that is, but my wifi barely sees my network. When I re-awaken the computer in normal mode, without he cinema display, the network can be connected to easily. Also, when I run the airport utility while using the cinema screen, you cannot see the airport express, but without the screen, you can.
    This is a weird wifi problem,=.
    Any help is appreciated.
    H

    This is known to happen:
    http://docs.info.apple.com/article.html?artnum=58543
    Try a different broadcast channel on the wireless router.

  • I am having a big problem downloading the basic essentials content

    Basic essentials content, 3 times in a day (This is after doing a clean install of OS X Lion on my Mac and then re-downloading Logic) i have/Logic has, tried to download the basic essentials content and then the download freezes.
    Whats happening?

    When you connect your iPod to iTunes, look on the Device/Photos pane and choose the one folder on your computer (for example "Pictures Set A") that you want to use to Sync with your iPod, by using the Browse button.
    In that folder ("Pictures Set A"), put any folders that you want to Sync with your iPod (such as "Holiday in London" and "Day Trip To Sydney" etc. etc.).  They are known as sub-folders. Sync the iPod to iTunes.
    On the iPod, in the Photos App, you will see a folder named Photo Library which has all your (Synced) photos in it, but without folders. Beneath the Photo Library folder are all the sub-folders, such as "Picture Set A" , "Holiday In London" and "Day Trip To Sydney". Each sub-folder has only the photos that are in that folder on your computer.
    For the photos that did not Sync to your iPod, I suggest you follow the message that you saw, "see iTunes for more information". The most likely explanation is that they are in a format the iPod cannot handle.

  • How to form a regular expression for matching the xml tag?

    hi i wanted to find the and match the xml tag for that i required to write the regex.
    for exmple i have a string[] str={"<data>abc</data>"};
    i want this string has to be splitted like this <data>, abc and </data>. so that i can read the splitted string value.
    the above is for a small excercise but the tagname and value can be of combination of chars/digits/spl symbols like wise.
    so please help me to write the regular expression for the above requirement

    your suggestion is most appreciable if u can give the startup like how to do this. which parser is to be used and stuff like that

  • Regular expression to abbreviate the names

    Friends,
    I have tables names like MY_TABLE_NAME, and I need to generate the abbreviations for the tables as MTN. Can any one help me to get using regular expression?
    Thanks,
    Natarajan

    SQL> select table_name, regexp_replace(initcap(table_name), '[[:lower:]]|_') new_tab_name from user_tables
    TABLE_NAME                     NEW_TAB_NAME                 
    UT_METADATA                    UM                           
    V_DELIVERY_DC_DW               VDDD                         
    V_DBWE_DW                      VDD                          
    PLAN_ZIP                       PZ                           
    JOB_HISTORY                    JH                           
    DEMO_USERS                     DU                           
    DEMO_CUSTOMERS                 DC                           
    DEMO_ORDERS                    DO                           
    DEMO_PRODUCT_INFO              DPI                          
    DEMO_ORDER_ITEMS               DOI                          
    DEMO_STATES                    DS                           
    DEMO_PAGE_HIERARCHY            DPH                          
    PLAN_TABLE                     PT                           
    UT_LOOKUP_CATEGORIES           ULC                          
    MV_CORES                       MC                           
    PRODUCTS_QUALITY               PQ                           
    V_BSTPOS_DW                    VBD                          
    TRN_BR                         TB                           
    GL_BR                          GB                           
    V_FAKTUR_DW                    VFD                          
    CHANGE_LOGS                    CL                           
    V_FAKTUR_OLD_DW                VFOD                         
    T_EXT                          TE                           
    TRANSFER_GLOBAL                TG                           
    ORDER_LINES                    OL                           
    T_ERR                          TE                           
    UT_SUITE_TEST_RESULTS          USTR                         
    UT_SUITE_RESULTS               USR                          
    UT_TEST_RESULTS                UTR                          
    UT_TEST_COVERAGE_STATS         UTCS                         
    UT_TEST_IMPL_RESULTS           UTIR                         
    UT_TEST_IMPL_ARG_RESULTS       UTIAR                        
    UT_TEST_IMPL_VAL_RESULTS       UTIVR                        
    UT_SUITE_TEST                  UST                          
    UT_SUITE                       US                           
    UT_LIB_DYN_QUERIES             ULDQ                         
    UT_LIB_VALIDATIONS             ULV                          
    UT_LIB_TEARDOWNS               ULT                          
    UT_LIB_STARTUPS                ULS                          
    UT_TEST_IMPL_ARGUMENTS         UTIA                         
    UT_VALIDATIONS                 UV                           
    UT_TEST_IMPL                   UTI                          
    UT_TEST_ARGUMENTS              UTA                          
    UT_TEST                        UT                           
    UT_LOOKUP_VALUES               ULV                          
    UT_LOOKUP_DATATYPES            ULD                          
    ERR_DT                         ED                           
    47 rows selected.

  • JAVA regular Expression problem

    i have a string AS FOLLOWS-
    "N\E'\ERAJ";
    u can create this string as --- > String str="N\\E'\\ERAJ "
    i want output as below--
    N\\E\'\\ERAJ
    don't us the looping.
    Thanks in advance.
    nJoy the Regular Expression.

    String myString = myString.replaceAll("\","\\");No. To merely double all backslashes, you would use  myString = myString.replaceAll("\\\\", "\\\\\\\\");But it looks like the OP wants to escape apostrophes as well:  myString = myString.replaceAll("(['\\\\])", "\\\\$1");...or possibly all punctuation characters:  myString = myString.replaceAll("(\\p{Punct})", "\\\\$1");

  • Regular expression problem?

    Hi I have a file which contains the following text
    <cfset objNews.strNewsTickerLink =
    "index.cfm?pageid=83">
    Now what i'd like to do is to scrape out the value of this
    variable i.e. 'index.cfm?pageid=83'. Now this variable can be
    different.... so basically whatever the value of the variable
    objNews.strNewsTickerLink is set to.. I'd like to get it out. Now
    I'm not that great with regular expressions... can anyone help me
    out?
    Thx

    Hi,
    One way of handling that is to use this UDF,
    http://cflib.org/udf/queryStringGetVar
    But, you must be aware of the url variable that comes after
    "?" symbol in order to use the above udf. If it is dynamically
    generated you need to write your own regular expression.
    HTH

  • Regular expression: check for the presence of special characters.

    I have the following requirement:
    I need to check for the presence of the following characters in a keyword: @, #, > if any of these characters are present, then they need to be stripped off, before going further. Please let me know the regular expression to check for these characters.

    I am trying to extend the same logic for the following characters:
    .,‘“?!@#%^&*()-~<>[]{}\+=`©® . here is the code fragment:
    Pattern kValidator = Pattern.compile("[\\.,\\‘\\“?!@#%^&*()-~<>[]{}\\+=\\`©®]");
    Matcher kMatcher = kValidator.matcher(keyWord);
    if (kMatcher.find(0)) {
    keyWord = keyWord.replaceAll("[.,\\‘\\“?!@#%^&*()-~<>[]{}\\+=\\`©®]", " ");
    }I get the following error. This error is from the weblogic command window. I dont understand these special characters.
    Error:
    28 Oct 2008 12:27:48 | INFO  | SearchController   | Exception while fetching search results in controller:Unclosed character class near index
    39
    [\.,\&#915;Çÿ\&#915;Ç£?!@#%^&*()-~<>[]{}\+=\`&#9516;&#8976;&#9516;«]
                                           ^
    java.util.regex.PatternSyntaxException: Unclosed character class near index 39
    [\.,\&#915;Çÿ\&#915;Ç£?!@#%^&*()-~<>[]{}\+=\`&#9516;&#8976;&#9516;«]
                                           ^
            at java.util.regex.Pattern.error(Pattern.java:1650)
            at java.util.regex.Pattern.clazz(Pattern.java:2199)
            at java.util.regex.Pattern.sequence(Pattern.java:1727)
            at java.util.regex.Pattern.expr(Pattern.java:1687)
            at java.util.regex.Pattern.compile(Pattern.java:1397)
            at java.util.regex.Pattern.<init>(Pattern.java:1124)
            at java.util.regex.Pattern.compile(Pattern.java:817)

Maybe you are looking for