How to search for a string with various occurrences using regexp_substr

Hi all.

My cenario's

'.... 456re0, 50kg 400, 500rfabs43qre30, 25kg 150, 354rf658... »


It is possible, using regexp_substr or another way to get the values, 0,50 and 400 500 and 30.25 150 354?

I am using [^ d] + [$kg] and the string comes, but only the first occurrence...

TKS.

claudioaragao wrote:
I need the results of...

with sample_table as (
                      select '....456re0,50kg400,500rfabs43qre30,25kg150,354rf658....' str from dual
                     )
select  regexp_substr(str,'re.*?rf',1,column_value) sub_str
  from  sample_table,
        table(
              cast(
                   multiset(
                            select  level
                              from  dual
                              connect by regexp_substr(str,'re.*?rf',1,level) is not null
                           )
                   as sys.OdciNumberList
                  )
            )
/ 

SUB_STR
-------------------
re0,50kg400,500rf
re30,25kg150,354rf

SQL> 

SY.

Tags: Database

Similar Questions

  • How to search for a string in a column using REGEXP


    Hi Forum,

    I have a table with a column that has records that contain one of the 3 words viz.

    TABLE X

    col1

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

    remit_method = EMAIL/remit_details = some other details

    remit_method = SMS/remit_details = some other details for sms

    remit_method = POST

    I need to write a SQL that captures the remit_method of the column. I wrote SQL using SUBSTR and INSTR to capture him. But I was wondering if I could do it using the functions of RegExp as well?

    SELECT REGEXP_SUBSTR (col1) == > how?

    Of

    (

    SELECT ' remit_method = EMAIL/remit_details = FROM DUAL some other details

    UNION

    SELECT ' remit_method = SMS/remit_details = some other details for FROM DUAL of sms

    UNION

    SELECT 'remit_method = POST' FROM DUAL

    ) ;


    Output must be

    1st row = > EMAIL

    Row2 = > SMS

    Row3 = > POST

    Thank you

    Maëlle

    Like this...

    SQL > ed
    A written file afiedt.buf

    1 with tablex as (SELECT ' remit_method = EMAIL/remit_details = col1 OF DOUBLE UNION some other details)
    2. SELECT ' remit_method = SMS/remit_details = some other details OF UNION of the sms for DOUBLE
    3. SELECT 'remit_method = POST' FROM DUAL
    4                 )
    5 SELECT REGEXP_REPLACE (col1, ' ^ remit_method =([[:alpha:]]+). * $', '\1') as remit_method
    REGEXP_REPLACE 6, (col1, ' ^. * remit_details =(.*) $ |. *', '\1') as remit_details
    7 * FROM tablex
    SQL > /.

    REMIT_METHOD REMIT_DETAILS
    -------------------- ----------------------------------------
    A few other details by E-MAIL
    Publish
    Other details for sms SMS

  • How to search for a string in the order reversed through REGEXP_INSTR

    Hi all

    I have the SQL query in which I want to get the first position of the occurrence of the end of the string

    for example:
    String:NBANK-ASD-00-1001-525-1002
    Condition: the position of the character '-' the last. (Note: character can also be '-' or ' / ')
    output: 1002

    for above condition, I have a request next return


    SELECT SUBSTR('NBANK-ASD-00-1001-525-1002',REGEXP_INSTR('NBANK-ASD-00-1001-525-1002','[^-/]',1),LENGTH('NBANK-ASD-00-1001-525-1002 ')) FROM dual;



    but I'm getting more results

    NBANK-ASD-00-1001-525-1002
    means that the expression returns 0...

    pls help me solve this problem.

    You can change your query as follows

     SELECT SUBSTR('NBANK-ASD-00-1001-525-1002'
       , REGEXP_INSTR('NBANK-ASD-00-1001-525-1002', '[^-/]*$', 1)
       , LENGTH('NBANK-ASD-00-1001-525-1002'))
       FROM dual;
    ;
    

    but you can just use REGEXP_SUBSTR to get the same result...

     SELECT REGEXP_SUBSTR('NBANK-ASD-00-1001-525-1002', '[^-/]*$', 1)
       FROM dual;
    ;
    

    Kind regards
    Bob

  • How a search for certain content through many files?

    Windows 7 claims to be able to search for certain substances, but it does not work, or is not properly documented. My filenames have the extension "ls2" and are open with Notepad. How can I search for a string in the content of my ls2 files?

    Hello

    Maybe this will help: (mainly those of type "BOLD" )

    Tips for finding files
    http://Windows.Microsoft.com/en-us/Windows-Vista/tips-for-finding-files

    How to use advanced search in Vista Options
    http://www.Vistax64.com/tutorials/75451-advanced-search.html

    How to restore the page button on the Start Menu after installing Vista SP1
    http://www.Vistax64.com/tutorials/145787-Search-start-menu-button-restore-after-SP1.html

    How to restore the context Menu item search after installing Vista SP1
    http://www.Vistax64.com/tutorials/134065-search-context-menu-item-restore-after-Vista-SP1.html

    How to create a shortcut on the desktop search in Vista
    http://www.Vistax64.com/tutorials/126499-search-desktop-shortcut.html

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

    Win Key F opens advanced search

    Searching in Windows Vista, part 1
    http://Windows.Microsoft.com/en-us/Windows-Vista/searching-in-Windows-Vista-part-1-secrets-of-the-search-box

    Part 2
    http://Windows.Microsoft.com/en-us/Windows-Vista/searching-in-Windows-Vista-part-2-Start-menu-and-control-panel-search-tips

    Part 3
    http://Windows.Microsoft.com/en-us/Windows-Vista/searching-in-Windows-Vista-part-3-using-advanced-search-for-those-hard-to-find-files

    I hope this helps.

    Rob Brown - MS MVP - Windows Desktop Experience: Bike - Mark Twain said it right.

  • Under XP I could search for a string in all the files on my computer. I can't find this search function of SMEs on Windows 7. Anyone?

    On Windows XP, there is a search function to search for a string in any kind of files on your computer. You are looking for a specific name was easy, if you fogort what kind of file, this name occurred in or what it was named.

    On Windows 7 it only allows searching for a name of a file.  How to search for strings in file names?  29/12/12 Paul Figueroa

    Oh, what you want is the content property.

    content: ~ = Figueroa

    [Update: apparently special search symbols such as ~ = do not work with the content when property indexed research places, but work during the search in unindexed locations.]

    I should mention that Windows 7 Search is not case sensitive, so it makes no difference to try to find upper or lower case letters.  In addition, Windows 7 Search is not able to search the contents of files that have no file extension.  There is also a weird question having to watch in Indexing Options to determine which file extensions are defined for content, research, where you have a type of unusual file that is not defined for the content of the search.

  • Debug: how to search a text string (s)?

    In the debug command, how to search for a text string?

    I tried both a mystring' and 'mystring' ' does not.  They return all two syntax errors ("^ error").

    "According to aid debugging (" "?" command "), the syntax is the list of the range".  Note that no argument is indicated as optional.

    If I enter a range, what is the syntax in general?  And what is the syntax for 'all '?

    I tried * 'mystring' ' does not.  I get the syntax error (' ^ error ") pointing on «*»

    And what is the syntax for the 'list', in particular to specify a text string?

    I wrote:

    In the debug command, how to search for a text string?

    Well, duh!  A Google search for "debug windows" (without the quotes) found this handy employment guide:
    http://thestarman.pcministry.com/ASM/debug/debug.htm.

  • How to search for a Word document in Windows 8?

    I'm stumbling around Windows 8 that came pre-loaded on my new laptop.  I ordered Windows and Excel to be included in the package.  I saved a number of documents in Word, and now I need to get these documents for a particular.  I looked on the Internet and found a lot of no-help, that is to say, 'go in search of a file'.  Excuse me, but if I could find searching a file, I could probably find out how to search for the file, Huh?  Thus,.

    Could someone please help me with: how to find a Word document (1) and (2) where is the infamous "search"?

    I did the thing 'sweep to the right side of the screen"to get those things shadow to appear, and click on the magnifying glass (which I think the engineers forgot to change when they changed everything!) and if I wanted to search for apps, I'd be in great shape.  But his files I'm looking for, Word documents.  The designers of this 'new' version improved - well, new, in all cases seem to have forgotten those of use who use computers for productive work and not socialize or play games.

    Sorry for the hike and whining, but I'm very frustrated that the tasks that were once very simple are now extremely difficult to fill.

    It's pretty easy, at the beginning screen just type the name of your document and right it will bring the search screen and you select files (files, settings, Apps). Take a look at:

    http://Windows.Microsoft.com/en-us/Windows-8/search-apps-files-settings

  • Please, give me an advise how to search for a number in a file xml (as3.0)

    Hello! Sorry for the troubling.

    Please, give me an advice how to search for a number in a file xml (as3.0)

    Thank you!

    My answer was based on your question to find numbers anywhere in the data to an xml file.  If you know that the data is digital data and the names of the nodes that contains this data, you do not have to check the characters and can only check numerical data using string values...

    function searchXMLFile(Event:MouseEvent):void
    {
    searchDisplay.text = "";
    var pageList:XMLList = xmlFileToSearch.receipt.number;
    searchDisplay.text = "false";
       
    for (var i: int = 0; i< pagelist.length();="">
    {

    If (pageList [i] == searchInput.text) {}
    searchDisplay.text = "true";
    }

    }
    }

    Even if you are looking for individual digital characters in the previous code that you would have always done by a false exit due having the line 'false' always cancel the real line...

    If (t.toString () .indexOf (m_sSearchTerm)! = - 1).

    {

    searchDisplay.text = "true";

    }

    searchDisplay.text = "false";  This will always overwrite the textfield

  • BY SPECIFYING THE NUMBER OF IDENTICAL CHARACTERS WHEN SEARCHING FOR A STRING

    Hey everybody,

    built-in indexOf() finds a character "." in the string "1.2.3." If value == 1.

    It looks nothing if the value == 0 or 2 or a number greater than 2.

    var txt:String = '1.2.3.';

    var: output string = String (this);


    If (txt.indexOf(".") == 1)

    {

    trace (output);     [object MainTimeline]

    }

    The must be a simple method to specify the number of characters "." When you search for the string "1.2.3.".

    For example, if there are 2 characters "." in the string "1.2.", then run it through a statement but if contains no 2 characters "." then do nothing.

    There is a built-in function called contains , but it is mainly used in XML.

    indexOf() resembles codes javascript unstable, one of these framework which unixers hatred.

    You don't have to use regular expressions to determine how many points is in the string. Use of split and read the length:

    var txt:String = '1.2.3.';

    trace (txt. Split("."). (length);

  • How to search for a particular word by selecting multiple text files

    Hello

    I have hundreads of text files and I need to search a particular word in these bunch of txt files.

    How do so by selecting all files and search for the word. I do not want to open each file and search for the word.

    I use Windows 7 here.

    Please suggest.

    Thank you...

    Anand

    I don't think that we are able to select the files to search, but what you can do, is have all files in a folder that is searched for.  Open a window for the folder that contains the files and use the Windows search box in the upper right of this window.  If you are looking for 'bread', enter:

    content: bread

    At the same time, if you want to restrict the search to the txt files, then enter

    content: bread ext:txt

    For more details you can read my reply to

    http://answers.Microsoft.com/en-us/Windows/Forum/Windows_7-files/how-do-i-search-all-of-my-documents-for-a-specific/7ba6c244-07fd-4F52-988d-e2e303b4bec9

  • need help for where and how to search for apps you want in windows store 8

    I just bought a SAMSUNG ATIV TAB 3 (XE300TZC), it has WINDOWS 8.  I went to the store Windows on my windows 8 to start the download of all my apps that I like and I found some of the apps and downloaded. But many of the apps I want to I don't think because I've noticed that it is not an option or small box for me to be able to get all the apps... I guess my question is how a search for specific applications on my STORE of WINDOWS 8?

    Hi Brandi,

    Thanks for posting your question on the Microsoft community.

    Thank you for details on the issue.

    Please see suggestions from HairyFool said on June 4, 2013 and check.
    http://answers.Microsoft.com/en-us/Windows/Forum/windows_8-Winapps/how-do-i-search-the-Windows-apps-store-on-my/75390438-4DBA-4a77-93cd-aa3b2153efce

    I hope this information helps.

    Please let us know if you need more help.

    Thank you

  • How to search for text in all of the PDF files on a mobile device?

    How to search for text in all of the PDF files on a mobile device?

    Not possible on mobile devices.

  • How can I change the registry values with a common search for the string and replace the function where I don't do all manually?

    Due to problems of space with my installation of XP Pro, (operating system has been installed on a 4 GB partition and I did have a copy of the OS to do a new installation) I am trying to move a number of files on a mounted drive.

    It is a way to search an entire record of [SPECIFY FOLDER] "C:\Program Files\" instances and replace each with "C:\Program Files\Overflow\ [SPECIFY FOLDER]" as a common discovery replace function?

    Also, I'll have to move several "Common Files" files in the mounted folder 'Overflow '. The method to make learning one should help me to do both. Manually, it will take most of thousand years that all the files in HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Components
    the files seem to have a key value have changed.

    I have already uninstalled and reinstalled some programs at the desired location, but many still use the "Common files" folder despite my having already changed the default installation directory path in the registry. Any help would be appreciated.

    Thank you

    NORTH CAROLINA

    One way:

    1. Start Regedit (start-> Run-> 'Regedit')
    2. Select the branch of the registry, or you are interested in changing.
    3. The export of this branch of the registry (file-> export) in a ".reg" file
    4. Use a programming editor (for example, the freeware Notepad ++) and use the "Find and replace" function to make the changes you want.  Save the modified file.
    5. After making the changes, double-click the .reg file to fold changes in your registry.

    As always, keep a backup of your original registry in case things get really bad and know how to do to restore this backup your machine should not be able to start.

    Notepad ++: <> http://notepad-plus-plus.org/ >

    HTH,
    JW

  • How to search for strings of characters defined, including accents in sqlplus?

    Hello

    the task is to find all the entries in the table produced in coloumn txtvi [defined as: VARCHAR2 (40 BYTE)] where the chain consists not only of these characters:

    -_ #., 0 - 9 a - za - zaouaou)

    The result set should be stored with characters that are not allowed.

    Example "Ziel/result" is not allowed; the "/" is not in the above defined characters

    DB-Version: 10.2.0.4.0

    NLS settings have the value:

    NLS_LANGUAGE AMERICAN

    NLS_CHARACTERSET UTF8

    First attempt was to use regular expressions in sqlplus:

    Select txtvi from product including the no regexp_like (txtvi,'^ [-_ #., 0 - 9 a - za - zaouaou ()] + $') order of txtvi.

    All combinations in the regexp_like has not given the correct result. As a result all games I found permits strings with accents.

    That would be the problem?

    Now, I started to watch all the channels with the German umlaut 'a' only.

    I've known that there are several titles with 'a '. An example: '% Fahrgastzahler % '.

    I started sqlplus in shell Korn on AIX 6.1 ($nls_lang = AMERICAN_AMERICA. UTF8)

    to find all strings containing a German umlaut:

    SQL > select txtvi from product where txtvi like '% a % ';

    ERROR:

    ORA-01756: city not properly finished chain

    I thought to do a simpler test:

    SQL > select 'a' twice.

    ERROR:

    ORA-01756: city not properly finished chain

    With 'o'.

    SQL > select 'o' double;

    '

    -

    o

    With

    SQL > select text product where the text like "% number % ';

    TXTVI

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

    Fahrgastzahlung #27N0

    Investigation Fahrgastzahler

    Great, there is a result. But it is not a solution. I'll find all rows with accents.

    Why is there an error ora-01756? I get the same error with the German ss, but u works as o.

    Only a problem in point 10.2?

    A test more in DB-Version: 11.2.0.3.0 with NLS_CHARACTERSET AL32UTF8

    and sqlplus ($nls_lang = AMERICAN_AMERICA. UTF8)

    SQL > select 'o' double;

    '�'

    ---------

    is

    SQL > select 'a' twice.

    ERROR:

    ORA-01756: city not properly finished chain

    No possible use of sqldeveloper:

    The sqldeveloper on a Win7 customer were not properly demonstrating accents. Results of German umlauts are empty every time.

    Yes, there is a problem with accents.

    Any idea how this problem can be solved?

    My suspicions were confirmed. The result of DUMPING indicates that problematic content is encoded in WE8ISO8859P1/WE8MSWIN1252 and not in UTF8, as it should. You see that the binary code of 'u' is 0xFC and for "O" 0xD6. Here's the WE8ISO8859P1/WE8MSWIN1252 codes, not UTF8 codes.

    Similarly, the test with "od" shows the code for "o" as 0xF6 on your terminal. It is, once again, a code WE8ISO8859P1/WE8MSWIN1252 and not UTF8 code, so the value of NLS_LANG is incorrect. Character set NLS_LANG must match the source of data, not the database character set. You correctly see the umlauts on the screen, because the screen is configured to WE8ISO8859P1 or WE8MSWIN1252 and these codes are retrieved not converted (NLS_LANG = DB charset).

    You should:

    1 recode your data to the right encoding, for example with the UPDATE tab1 SET col1 = CONVERT(col1,'UTF8','WE8MSWIN1252') WHERE... Note that this conversion be done several longer strings, so you must make sure that they will always go in the target column and you do not get errors "value too long."

    2. review and correct the NLS_LANG value for all customers. The mentioned AIX session should run with NLS_LANG value WE8ISO8859P1. You will see the data correctly with this setting once the data are converted as described in 1 above.

    Your tests research should work much better with a correct database.

    Thank you

    Sergiusz

  • How to search for a location number anywhere in the string

    I am looking for a string to a number (integer or float) without knowing its index in the string and to extract it - whether in digital format or a string.  for example "52,63 number appears in this string." I want to extract/identify "52,63.

    The functions I've met seem to expect the index to be known or number to be at index 0.  How can I achieve this?

    Best regards.

    Kenoss


Maybe you are looking for