Use regular expressions to extract .llb file from the path name

I'm trying to be smart (always a dangerous thing) and use a regular expression to extract the name of a library to a filepath converted to a string.   While I appreciate there are other ways to do this, regex seems to be a very powerful way of neat, I would be able to operate.

IE, if I have a string of type, C:\applications\versions\library.llb\toplevel.vi, I want to be able to extract the library.llb of the string, because it will be of variable length, may include the numbers & spaces and may be located in a file of variable depth hierarchy.   In other words, I want to extract the part of the string between the last-which ends with .llb

The best I managed so far is \\+.*llb who all returned less the drive letter and the toplevel.vi

Can someone help me to achieve this goal, or I'm better by using an alternative method (for example filepath string in array, search for .llb)

Thank you

Matt

Hi Matt,

attached you will find two other options.

Mike

Tags: NI Software

Similar Questions

  • When you use Internet Explorer, I can download files from the incredimail site. This does not work when I use Firefox. I see no differences in the settings. Can someone help me?

    I can download IncrediMail gold Gallery when I use internet explore content how I want, but when I use firefox sometimes it allows me to download content from the Gallery, but would not allow me to download more, or he wouldn't let me just download

    • "Clear the Cache": Tools > Options > advanced > network > storage (Cache) offline: 'clear now '.
    • 'Delete Cookies' of sites that cause problems: Tools > Options > privacy > Cookies: "show the Cookies".

    Start Firefox in Firefox to solve the issues in Safe Mode to check if one of the Add-ons is the cause of the problem (switch to the DEFAULT theme: Tools > Modules > themes).

    • Makes no changes on the start safe mode window.

    See:

  • Sent files - items have disappeared from the folder "sent" in Outlook Express after I transferred files from the "sent" folder to a new folder

    I have windows XP and today under the sent items, I created another folder called sent items 2011. I transferred some of the files of items to be sent envoys 2011 article folder. The other files in the sent items folder disappeared. Please help me to restroe the former sent files.

    Check the messages to the new folder and deleted items. Have a a + in front of them?
     
    If not, I don't know what went wrong in order to check the Recycle Bin of Windows and the BAK files OE message store. If you find any, post back before doing anything.
     
    You drag messages to the new folder?
     
    Hint 1: always right click | Copy here and if he succeeds, go back and remove the original messages.
     
    Tip 2: Save your messages. This freeware tool backs up everything on OE in seconds. Ignore what is written in red. Which refers to another program.
     
    Outlook Express Quick Backup (OEQB)
    http://www.oehelp.com/OEBackup/default.aspx 
  • Extraction of files from the recycling bin

    I tried to restore the emails compacted in the recycling bin, but all the files have disappeared. I pressed only restore not delete. Can someone tell me where they went and if I can get back them?

    Hello

    Thanks for posting the request in the Microsoft Community.

    I suggest you to check under the place where you had originally deleted files. Once you click on restore, the files will restore to its original location.

    I suggest also refer to the link and search for the missing files:

    How to search for files and folders in Windows XP

    http://support.Microsoft.com/kb/308895

    Let us know if it helps.

  • How to extract the value of a tag XML using regular Expressions

    We get a response XML from a WEB SERVICE.

    I convert it to VARCHAR2.

    Now, I want to get the real answer that is inside the tag of the response.

    I tried this:

    DECLARE

    V_1 VARCHAR2 (30000): = ' < soap: Body > < ns:ProcessArgusFeedsResponse xmlns:ns = "urn: PegaRULES:SOAP:ArgusToPegaFeeds:Services" > ' |

    '< response > good < / answer >< / ns:ProcessArgusFeedsResponse > < / soap: Body > ';

    v_response VARCHAR2 (100);

    BEGIN

    DBMS_OUTPUT. PUT_LINE (V_1);

    v_response: = REGEXP_SUBSTR (v_1, ' / < >(.+?) < \/Response > answer /');

    dbms_output.put_line (v_response);

    END;

    It does not work.

    Any help would be greatly appreicated.

    Hello

    user12240205 wrote:

    We get a response XML from a WEB SERVICE.

    I convert it to VARCHAR2.

    Why?  XML has its own native ways of analysis; Why not use them?

    If you use regular expressions, then REGEXP_REPLACE, as shown above, is a good option in Oracle 10, but starting in Oracle 11.1, you can use REGEXP_SUBSTR like this:

    REGEXP_SUBSTR (v_1

    , '(.+?)'

    1

    1

    NULL

    1

    )

    The 6th argument is like a backreference; "He tells REGEXP_SUBSTR did not return to the entire organization, but only the part inside the 1st left '(' et correspondant à sa droite).

    The '?' to make it non-greedy is necessary only if v_1 can contain more than one response.

    Now, I want to get the real answer that is inside the tag of the response.

    I tried this:

    DECLARE

    V_1 VARCHAR2 (30000): = "" |

    'Good';

    v_response VARCHAR2 (100);

    BEGIN

    DBMS_OUTPUT. PUT_LINE (V_1);

    v_response: = REGEXP_SUBSTR (v_1, ' /(. +?)) <\ esponse="">/');

    dbms_output.put_line (v_response);

    END;

    It does not work.

    That's because it's looking for a slash ("/") before the '' tag and another after the ' tag.

    The backslash ("\") is not necessary here, but it is not nothing wrong.

  • One for the era: how to get this output using REGULAR EXPRESSIONS?

    How to get the bottom of output using REGULAR EXPRESSIONS?
    SQL> ed
    Wrote file afiedt.buf
    
      1* CREATE TABLE cus___addresses    (full_address                   VARCHAR2(200 BYTE))
    SQL> /
    
    Table created.
    
    SQL> PROMPT Address Format is: House #/Housename,  street,  City, Zip Code, COUNTRY
    House #/Housename,  street,  City, Zip Code, COUNTRY
    SQL> INSERT INTO cus___addresses VALUES('1, 3rd street, Lansing, MI 49001, USA');
    
    1 row created.
    
    SQL> INSERT INTO cus___addresses VALUES('3B, fifth street, Clinton, OK 74103, USA');
    
    1 row created.
    
    SQL> INSERT INTO cus___addresses VALUES('Rose Villa, Stanton Grove, Murray, TN 37183, USA');
    
    1 row created.
    
    SQL> SELECT * FROM cus___addresses;
    
    FULL_ADDRESS
    ----------------------------------------------------------------------------------------------------
    1, 3rd street, Lansing, MI 49001, USA
    3B, fifth street, Clinton, OK 74103, USA
    Rose Villa, Stanton Grove, Murray, TN 37183, USA
    
    SQL> The REG EXP query shouLd output the ZIP codes: i.e. 49001, 74103, 37183 in 3 rows.
    Published by: user12240205 on June 18, 2012 03:19
    /* Formatted on 2012/06/18 17:25 (Formatter Plus v4.8.8) */
    SELECT REGEXP_SUBSTR ((REGEXP_SUBSTR (full_address, '[^,]+', 1, 4)), '[[:digit:]]+') RESULT
      FROM cus___addresses
    
  • How to extract the files from the HARD drive?

    I have a HDD1805 from a broken iPod 80 GB. I was wondering if there was another method I could use to extract the files from the hard drive.

    Hello

    Sorry, but I don t know what you mean exactly.
    Can you please explain exactly what you mean?

    What files you want to extract?

    Good bye

  • No luck trying to extract the .inf files from the drivers downloaded as zip files

    Hello

    I try to extract the .inf files from the drivers downloaded as files zip on the Toshiba site, but I'm having no luck.

    I'm trying to deploy images by using WDS on Server 2008 and need inf files if it is to succeed, there the answer to this problem.

    Thanks in advance.

    Hello

    I can unpack any driver package downloaded from the Toshiba driver page.
    I use the free tool called WinRAR.

    Maybe it helps you

  • How to extract files from the Windows 7 installation CD?

    I remember that on Win98, I can use SFC. EXE to extract all those files. CAB files on the installation of Win98 CD and place the files extracted into a folder I want. In addition, I don't need to know where. CAB of the target file should be some.

    The SFC. EXE in Win7 replces only system files. It does not extract and put all the files as the SFC in Win98.

    So, how to extract files from Windows 7 installation CD?

    Hello

    ·         Why you want to extract the file from the Windows 7 DVD?

    ·         What file you want to extract?

    Some of the files will be locked or currently in use by the system so that you will not be able to replace their while that started in Windows 7. Therefore, SFC scan tool is used to repair any file corruption in windows 7.

    Design by default, you can extract the files. You can copy and paste the file into your Windows 7 DVD drive, refer to the article below:

    http://Windows.Microsoft.com/en-us/Windows7/copy-and-paste-a-file

    Hope this helps,

  • Chips with 3 delimiter characters using regular expressions

    Hello world

    I have a function that is able to mark the input in a collection string using regular expressions.

    In case the input string is a character such as the comma or semicolon delimiter,

    We can just get the result we want like the example below.

    SQL> select * from v$version;
    
    
    BANNER
    --------------------------------------------------------------------------------
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE    11.2.0.1.0      Production
    TNS for 64-bit Windows: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    

    SQL> with tab1 as (
      2      select 'abc,dfg,h,,1234' as col1 from dual
      3  )
      4  select regexp_substr(col1, '([^,]*)(,|$)', 1, level, 'i', 1) as result
      5  from tab1
      6  connect by level <= regexp_count(col1, ',')+1;
    
    
    RESULT
    ---------------
    abc
    dfg
    h
    
    1234
    

    But in the case where the channel of entry has 2 types of delimiter and each delimiter consists of 3 characters as below

    I wonder if it is possible to get the result as below.

    The input string: 01| ^ | ABCD| ^ | 111| * | 02| ^ | efgh| ^ | 222

    Separators: | * | is divided into lines, | ^ | is divided into columns

    Expected result:

    col1 col2 col3

    Row1 - > 01 abcd 111

    row2-> efgh 02 222

    Simply put, take a next

    The input string: 01| ^ | ABCD |^| 111 |*| 02 |^| efgh |^| 222

    Separator: | * |

    Result:

    01. ^ | ABCD | ^ | 111

    02. ^ | efgh | ^ | 222

    How can I achieve this using regular expressions?

    Kind regards

    Euntaek

    You need to know the number of the column from the outset:

    with tab1 as)

    Select ' 01 | ^ | ABCD | ^ | 111. * | 02. ^ | efgh | ^ | 222' as double col1

    )

    Select rownum,

    regexp_substr (regexp_substr (col1 '(.*?) ((\|\*\|)| $) ', 1, level, null, 1),'(.*?) ((\|\^\|)| $) ', 1, 1, null, 1) col1,.

    regexp_substr (regexp_substr (col1 '(.*?) ((\|\*\|)| $) ', 1, level, null, 1),'(.*?) ((\|\^\|)| $) ', 1, 2, null, 1) col2.

    regexp_substr (regexp_substr (col1 '(.*?) ((\|\*\|)| $) ', 1, level, null, 1),'(.*?) ((\|\^\|)| $) ', 1, 3, null, 1) col3

    of tab1

    connect by level<= regexp_count(col1,'\|\*\|')="" +="">

    /

    ROWNUM COL1 COL2 COL3

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

    1 01 abcd 111

    2 efgh 02 222

    SQL >

    SY.

  • String format using regular expressions

    Input string output format...
    
    SELECT q'<select ab_c "ABC", efg "EFG" from dual>' str FROM DUAL
    
    Output:
    
    STR                                  
    -------------------------------------
    select ab_c "ABC", efg "EFG" from dual
    
    
    Required output format using regular expression...
    
    
    STR                                  
    -------------------------------------
    select 'ab_c' "ABC", 'efg' "EFG" from dual

    Regular expressions have many limitations as tools of analysis, and you specify the rules you want. This expression puts quotation marks around a non-empty string before a quoted string:

    SELECT regexp_replace(q'