Regexp_substr help


String

Waiting

-Msg_erreur - process started with the parameters - Source schema:-MyPersonalSchema, target schema:-SandBoxTarget, Mode:-the TWO restart Id:-1453BOTH

In above the string column grid I have string and I expect TWO to extract the string.

So far, I have tried is underneath SQL, I know regular expression are powerful and strong enough to solve/snippet string using regexp_substr himself without the help of another function.

However, I tried below, but being a newbie I came to this day only.

SQL> with t (str) as (select '-Error_MSG- Procedure started with parameters - Source Schema:-MyPersonalSchema, Target Schema:-SandBoxTarget, Mode:-BOTH, Restart Id:-1453'
  2                            from dual)
  3  select regexp_substr(str,'([^:-]*)([^,]+)',1,3,'i',2) either_i_use_this
  4             ,regexp_substr(str,'([^:-]+)',1,6,'i')  How_to_remove_after_comma
  5    from t;


EITHER_I_USE_THIS              HOW_TO_REMOVE_AFTER_COMMA
------------------------------ ------------------------------
:-BOTH                         BOTH, Restart Id


SQL>

Oh Oops, I forgot to put the sign less in front BOTH in option

where d)

Select ' - msg_erreur - process started with the parameters - Source schema:-MyPersonalSchema, target schema:-SandBoxTarget, Mode: the TWO restart Id:-1453' double txt)

Select txt, regexp_substr (txt, '. * (:(-) MODE?) (. *)) (en). (*', 1, 1, 'i', 3) d;

That's why I meant 7 characters...

as far as I know, only the OP can answer if the negative will always be there

Tags: Database

Similar Questions

  • Regexp_substr helps.

    Hello
    with t as
    (select 12857854 id from dual union all
    select 1573321 id from dual union all
    select 95634321 id from dual)
    select * from t
    Could you people please help me at first characters little except the last 3 digits of the data using the ordinary exprassion.

    Output
    12857
    1573
    95634
    Thank you.

    Like this

    with t as
    (select 12857854 id from dual union all
    select 1573321 id from dual union all
    select 95634321 id from dual)
    select id, regexp_replace(id, '[[:digit:]]{3}$') from t
    
  • helps the regexp_substr

    Hi all

    I've got statement
    with example as 
    (select '4578, WILD STORM, S.TURK-DELIGHT, 44' as str from dual)
    select case when regexp_substr(str,'S.[[:alpha:]''-]*,') is not null
                     then regexp_substr(str,'S.[[:alpha:]''-]*,') 
                     else '' 
             end as str 
    from example
    It returns 'STORM', while I need 'S.TURK - DELIGHT.

    Help me to get the desired result.

    Don't forget '. ' is a wildcard character, so you must escape a------.

    HTH

  • Help me about features as regexp_substr, regexp_replace

    Hello world
    Can someone help me understand these functions such as regexp_substr, regexp_replace...
    Will be better if Tunis examples with different situations or it may be links



    THX

    its here... in the forum itself.

    Introduction to regular expressions...

    Vivek L

  • Regexp_substr | starting the regex need help

    Hello

    I need where to go a single string that contains the full qualified table name [schemaname.tablename] I need to break schemaname then tablename

    Schema_name Table-name
    SCHEMA1TABLE1:
    SCHEMA2TABLE2
    SCHEMA3TABLE 3
    SCHEMA4TABLE 4

    : SCHEMA_NAME = ' SCHEMA1. TABLE1, SCHEMA2. TABLE 2, SCHEMA3. TABLE3, SCHEMA4. TABLE 4 '

    So far I've written it, Yes, there is much to learn through.

    Please comment to let me know what I missed and how to overcome these errors

    SELECT RTRIM (REGEXP_SUBSTR (: SCHEMA_NAME, '\w+\.', 1, LEVEL),'.) ') AS SCHEMA_NAME

    , RTRIM (REGEXP_SUBSTR (: SCHEMA_NAME, '\w+\,+', 1, LEVEL), ',') AS TABLE_NAME

    OF THE DOUBLE

    CONNECT REGEXP_SUBSTR (: SCHEMA_NAME, ' [^,] +', 1, LEVEL) IS NOT NULL

    SELECT REGEXP_SUBSTR (: SCHEMA_NAME, '\w+', 1, LEVEL * 2-1) AS SCHEMA_NAME

    , REGEXP_SUBSTR (: SCHEMA_NAME, '\w+', 1, LEVEL * 2) AS TABLE_NAME

    OF THE DOUBLE

    CONNECT REGEXP_SUBSTR (: SCHEMA_NAME, ' [^,] +', 1, LEVEL) IS NOT NULL

    You were close. Just take the fitting level calculation

  • help required in regexp_substr

    Hi all

    "In fact I want to cut the BHK' 1' of ' villa 1 BHK.

    I can separate the 'villa' of ' 1 BHK Villa"in

    SQL > select REGEXP_SUBSTR ('1 BHK Villa ',' [^ ""] +' 1, 3) from DUAL;

    REGEX

    -----

    Villa

    "" but please could you me how can we separate ' 1 BHK ' of ' villa 1 BHK.

    Concerning

    Rajat

    GregV wrote:

    Hello

    If you want to take the last piece of text (of the last space at the end of the string):

    SELECT REGEXP_SUBSTR ('1 BHK Villa', '(^.+) [[: space:]]. + $', 1, 1, 'i', 1) FROM DUAL;

    Two ways, I prefer this:

    1. SELECT

    2 REGEXP_replace (1 BHK 'Villa'

    3                 ,' [^ ]+$'

    4                        ) s

    5 * OF THE DOUBLE

    >/

    S

    -----

    1 BHK

    1. SELECT

    2 substr ('1 BHK Villa'

    3          ,1

    4, instr ("1 BHK Villa ',' ', - 1")-1

    5              )

    6              s

    7 * OF THE DOUBLE

    >/

    S

    -----

    1 BHK

  • How to remove the REGEXP_SUBSTR space

    Choose the length (TRIM (REGEXP_SUBSTR ('V, 370498, 658561477, 20150917, 4.37

    (((' [^,] +' 1, 5))) of the double

    output

    ---

    9

    Select TRIM (REGEXP_SUBSTR ('V, 370498, 658561477, 20150917, 4.37

    ((' [^,] +' 1, 5)) of the double

    output

    -----

    20150917


    last value actual length 8 only

    can help me please for these

    Thank you

    Thanks for the help

    to replace suggested used

    fix

    Choose the length (regexp_substr (regexp_replace ('V, 370498, 658561477, 20150917, 4.37

    (' [[: space:]] *', ")," [^,] (+' 1, 5)) solution, "

    length (rtrim (regexp_substr ('V, 370498, 658561477, 20150917, 4.37

    ', '[^,]+', 1, 5)

    10) has contributed to

    Double;

    Hi odie_63

    I replied to your previous one (csv to xml using ult_file pl/sql conversion ), it is also very good

    Thank you...

  • REGEXP_SUBSTR returns the second group

    (occuranHi! Need help. I'm trying to use regexp_substr to get the channel number. But Oracle returns me NULL when I choose the second game.

    INPUT STRING:

    Line 255 #: 05:59:51.050639000: startup process filling 188234978

    When I choose the first (default) game - it returns:

    start the process of filling 188234978

    SQL:

    Select REGEXP_SUBSTR (' #255 line: 05:59:51.050639000: start filling out the process 188234978', '(start process fill) (\w+)',1,2( )

    de double


    Why?


    Database Oracle 11.2.0.4.0 x 64

    In my opinion, there are two groups:

    1 # start process filling 188234978

    2 # 188234978

    Yes, there are two groups, but that one game.

    Do not confuse the number of occurrence of a pattern for the number of a corresponding model group.

    It looks more like what you are looking for:

    select regexp_substr(
             'Line #255: 05:59:51.050639000 : start process fill 188234978'
           , 'start process fill (\d+)'
           , 1
           , 1     --< first occurrence of the pattern
           , null
           , 1     --< there you can choose the group in the matching pattern
           )
    from dual ;
    

    However, there are probably more effcient ways of doing, without regex.

  • Please help me find the solution for the query

    Hi Experts,

    Please help build a sql query. Thank you

    Examples of data

    -------------------

    create the table Material_tb

    (

    Detail varchar2 (20).

    Description varchar2 (200)

    )

    /

    Start

    Insert into material_tb values('Color','Red,Blue,Black,Green,White');

    Insert into material_tb values ('Material','Gold, Silver, Platinum');

    end;

    /

    Select * from material_tb;

    DETAIL DESCRIPTION

    -------------------- ------------------------------

    Color red, blue, black, green, white

    Material gold, silver, Platinum

    I want that output voltage

    DETAIL DESCRIPTION

    -------------------- ------------------------------

    Red color

    Blue color

    Black color

    Green color

    White color

    Material gold

    Silver material

    Platinum material

    You can try under sql

    select distinct detail,regexp_substr(description,'[^,]+',1,LEVEL)
     from material_tb
    connect by regexp_substr(description,'[^,]+',1,LEVEL) is not null
    order by 1
    
  • regexp_substr: retrieve a block of text between delimiters

    Hello

    regexp_substr is very powerful, but not so easy to understand. I'll try to do my best, but I need your help.

    My question is this: I have a multiline text, stored in a database field. The text is structured as a "windows.ini" file: there are sections in square brackets and the lines of text in the section.

    I want to retrieve all of the text in a given section, and I think it's possible using regexp_substr.

    Here is the text of the field (in bold the part I want back):

    ---

    [ARTICLE 1]

    AAA = 123

    BBB = 456

    CCC = 789

    [ARTICLE 2]

    DDD = 987

    EEE = 654

    ---

    In other words, is there a way to retrieve the text between [ARTICLE 1] and [ARTICLE 2]?

    Thank you in advance.

    Concerning

    Select

    regexp_substr (txt, ' [de] [^] +', 1, level * 2) s

    t

    connect by level<= regexp_count(txt,="">

  • regexp help

    Hello

    I need to extract deposited number. Can please help me this extract using regexp.

    for ex:

    at the bottom of the message, I need to extract the value 434234234235435345634345 using REGEXP

    ORA-20102: cw_upload_queue_item_meta | ec3_unique_file_ref:434234234235435345634345 | ORA-00001: unique constraint (IBIS. CW_UPLOAD_QUEUE_ITEM_META_PK) violated

    user575115 wrote:

    Thx.It works in 11g, 10g too error throw

    That's why you have to mention your db version 4-digit during the validation of the questions:

    Select

    LTRIM (regexp_substr ('ORA-20102: cw_upload_queue_item_meta | ec3_unique_file_ref:434234234235435345634345 |)) ORA-00001: unique constraint (IBIS. ((CW_UPLOAD_QUEUE_ITEM_META_PK) violated ',': [^ |] +', 1, 2),': ')

    f

    of the double

  • REGEXP_SUBSTR I need any word val, including space, or null

    Hi all

    I need to separate the last value in the field, but my query spaces not considered between the delimiters, please help thanks...

    SELECT RTRIM (REGEXP_SUBSTR ('C | 00013010101 |)) C00009 | 009402 | 00000100.000 | 1. AZUSDINE 500 MG TABLET | AZULFIDINE | 00016010101 | 1. 19950118 | 20150330 | 00000000 | 00000000 | 0 | F | 9. 1. 1. 0 | 1. 1. AB | 00000000 | 1. 0 | 000 | 0 | 0000001 | 00,000 | 00,000 | 00,000 | 0000012 | 0000012 | AB | TAB | 00000001.000 | 19900930 | 19900930 | 00000000 | 1. 19950701 | 2. 0 | BOTTLE | 0 | 20080925 | 20110928 | 0 | 0 | 0 | AB | 00000100.000 | 0 | 00 | AB | 2. 2. 9. 3. 1. I have | AZULFIDINE 500 MG TABLET '

    (' [a-zA-Z0-9] +--------|?', 1, 72),' | ') Double val

    output

    VAL

    -----

    AZULFIDINE

    Mandatory

    PUT out, VAL: AZULFIDINE 500 MG TABLET

    Thank you

    Olivier

    If the number of fields is fixed, if you always want (in this case) the 69th field, you could do that (I replaced your channel hardcoded with a column called "input_string" for clarity):

    SELECT RTRIM (REGEXP_SUBSTR (input_string |'|)) ',' [^ \ |] *\|',1,69),'|') Val from your_table

    If you want just the entire last section, you can do it without using regular expressions at all:

    SELECT SUBSTR (input_string, INSTR(input_string,'|',-1) + 1) val from your_table

  • REGEXP_SUBSTR simple query

    Hi all

    Select RTRIM (REGEXP_SUBSTR('675809532|11787148|0','[a-zA-Z0-9]+\|'),'| ') double cardid

    Output

    --------

    675809532

    form above query I had the first value 675809532 how can I second valueor third value only pls help for these

    I need to pass the value to the variable individally

    Thank you...

    By adding the occurece to the RegExp as:

    Select RTRIM (REGEXP_SUBSTR ("675809532 |")) 11787148 | 0','[a-zA-Z0-9] + \| ?', 1,2),'| ') the double cardid

    and the regular expression would be easier that way:

    Select REGEXP_SUBSTR ('675809532 | 11787148 | 0', ' [^ \ |] +' 1, 3) double cardid

    HTH

  • using regexp_substr

    Hello

    I need to extract the first five characters digital of the specified column. I'm able to reach the requirement using substr and definition of functions.

    I learned that the use of regular expressions we can achieve in a simple way. Please find below the test data.

    with t as (select '123456suri' double empid

    Union all select 'suri436789' of the double

    Union all select '521521suri' of the double

    Union select all 'suri785643abc' of the double)

    select * from t ;

    Desired output:

    EmpID

    ---------

    12345

    52152

    Please help me how to extract the results required using REGEXP_SUBSTR.

    I tried with query below, but not able to restrict the result to only five digits.

    Select double regexp_substr('3456789suri123','[0-9]+',1,1)

    Thank you

    Suri ;-)

    Post edited by: Suri - added query

    Good first try

    \d is a shortcut for [0-9]

    What happens when you try to \d\d?

    How about \d\d\d?

    You should be able to guess the rest of there

    You can also use {n} means "repeat exactly n times.

  • REGEXP_SUBSTR - how to use case-sensitive

    I use REGEXP_SUBSTR with case-insensitive option

    while I use as below

    Select REGEXP_SUBSTR ("uk123 research", "UK", "i") double column;

    It displays error: ORA-01722: invalid number

    Help, please...

    Oracle 11.2.0.1.0

    You provide all the required parameters. See the http://docs.oracle.com/cd/B28359_01/server.111/b28286/functions138.htm#SQLRF06303 documentation

    Here's the correct query:

    select REGEXP_SUBSTR('search for uk123', 'UK',1,1,'i' )  col_name from dual;
    

Maybe you are looking for

  • Tecra A4 is unbootable

    Hi people I have a tecra A4 and began to experience problems starting after a stop. the laptop takes 15 minutes to allow me to restart it if I started right after that I stopped him. When I press the button to start it would take 2-3 seconds then sto

  • NFSU has quit unexpectedly

    "NFSU has unexpectedly" is the message I get after playing for about 1 minute. I saw many other people with the same complaint on other forums but you have not seen it mentioned on the forums of Palm. Despite what is a 3rd party app, I write here bec

  • spectrum 360: loading software

    I would like to transfer programs I had on my old hp computer.  My new 360 spectrum does not have an optical drive.  How can I download through cd?  I have a dvd player with hdmi, but I think that the hdmi is only for output.

  • Guard cursor jumping around while I type

    Original title: keyboard I type some words and all of a sudden, I noticed that the cursor jumps back and I find myself typing in the middle of my sentence. It took me like 5 minutes just for this type. She tends to jump back only (not really before?)

  • device Mangr. Watch the unit once the next time point device

    I tried to update my drivers with Driver Detective program. In the Device Manager. sometimes shows three inscriptions of IEEE1284.4 and sometimes shows not the whole list. In addition there is no registration for a HP 4300 printer while the printer w