Match pattern for multiple strings in labVIEW

I want to include multiple strings for matching in the regular expression for pattern matching.I tried using the or option and (|)
eg:cat|dog|mouse
If the string contains any of these it should show a match.
Is it possible in labview or do i need to use multiple patch mattern functions to achieve this?

Match Regular Expression function will do.
You can search for multiple strings using | operator. This function will return the match of any one of the specified strings seperated by | operator

Similar Messages

  • Regex Pattern For this String ":=)"

    Hello All
    True, this isn't the place to ask this but here it is anyway, if you can help please do.
    Can anybody tell me the regex pattern for this String:
    ":=)"
    Thanks
    John

    Yep, cheers it's ":=\\)"
    public class Test {
         public static void main( String args[] ) {
              String s = "one:=)two:=)three:=)four";
              String ss[] = s.split( ":=\\)" );
              for( int i=0; i<ss.length; i++ )
                   System.out.println( "ss["+i+"] = {" + ss[i] + "}" );
    }resulting in:
    ss[0] = {one}
    ss[1] = {two}
    ss[2] = {three}
    ss[3] = {four}

  • How to install Spectral Measurements and Modulation Toolkits for multiple versions of Labview

    I installed NI-RFSG, NI-RFSA, the Spectral Measurements Toolkit, and the Modulation Toolkit.  I have both LabVIEW 7.1 and 8.0 installed on my system.  I developed an application in LV 8.0 and now I need to revert it to LV 7.1.  The problem I am having is that add-on toolkits seem to only have been installed for LV 8.0 because there are several missing VIs and controls when I try to open the LV 7.1 version.  I tried re-installing the toolkits, but this is not fixing the problem.  How can I get the installer to install the toolkits for both versions of LabVIEW?
    Thanks for your help,
    Cherie
    Solved!
    Go to Solution.

    Hello Cherie,
    it's a know issue. You can read it in the modulation toolkit readme :
    Two Versions of LabVIEW Installed
    The installer supports installation of the Modulation Toolkit into a single
    version of LabVIEW; installation of the Toolkit into multiple separate
    installations of LabVIEW (for instance LabVIEW 7.0 and LabVIEW 7.1 installed
    on the same PC and in separate directories) is not supported or recommended.
    An unsupported means of doing so though involves manually copying files from
    one LabVIEW installation to another. To do so, you can install the
    Modulation Toolkit to the home directory of one LabVIEW installation, and
    then manually copy the installed files to the other LabVIEW installation.
    The following list includes pertinent directories and files. Copy all files
    from these directories, including any subdirectories, using the equivalent
    relative paths to the LabVIEW home directory for the target.
    <LabVIEW Home>\vi.lib\AddOns\Modulation\*.*
    <LabVIEW Home>\vi.lib\AddOns\NISML\*.*
    <LabVIEW Home>\examples\Modulation\*.*
    <LabVIEW Home>\resource\objmgr\NIMTAttribs.rc
    <LabVIEW Home>\resource\objmgr\NIMTAttribs.rch
    <LabVIEW Home>\help\lvmod.txt
    <LabVIEW Home>\help\lvmod.chm
    <LabVIEW Home>\help\lvdmt.txt
    <LabVIEW Home>\help\lvdmt.chm
    Note that this listing does not include all installed files. Also, copying
    files in this manner is not equivalent to a full installation into the
    alternative version of LabVIEW. Most notably error text unique to the
    Modulation Toolkit will not be updated and the Example Finder listings will
    not show the Modulation Toolkit examples.
    jerome
    "CherieC" <[email protected]> a écrit dans le message de news:
    [email protected]...
    >I installed NI-RFSG, NI-RFSA, the Spectral Measurements Toolkit, and the
    >Modulation Toolkit.&nbsp; I have both LabVIEW 7.1 and 8.0 installed on my
    >system.&nbsp; I developed an application in LV 8.0 and now I need to revert
    >it to LV 7.1.&nbsp; The problem I am having is that add-on toolkits seem to
    >only have been installed for LV 8.0 because there are several missing VIs
    >and controls when I try to open the LV 7.1 version.&nbsp; I tried
    >re-installing the toolkits, but this is not fixing the problem.&nbsp; How
    >can I get the installer to install the toolkits for both versions of
    >LabVIEW?
    > &nbsp;
    > Thanks for your help,
    > Cherie

  • Script to search all files in specified folder for multiple string text values listed in a source file and output each match to one single results txt file

    I have been searching high and low for this one.  I have a vbscript that can successfully perform the function if one file is listed.  It does a Wscript.echo on the results and if I run this via command using cscript, I can output to a text file
    that way.  However, I cannot seem to get it to work properly if I want it to search ALL the files in the folder.  At one point, I was able to have it create the output file and appear as if it worked, but it never showed any results when the script
    was executed and folder was scanned.  So I am going back to the drawing board and starting from the beginning.
    I also have a txt file that contains the list of string text entries I would like it to search for.  Just for testing, I placed 4 lines of sample text and one single matching text in various target files and nothing comes back.  The current script
    I use for each file has been executed with a few hundred string text lines I want it to search against to well over one thousand.  It might take awhile, but it works every time. The purpose is to let this run against various log files in a folder and
    let it search.  There is no deleting, moving, changing of either the target folder/files to run against, nor of the file that contains the strings to search for.  It is a search (read) only function, going thru the entire contents of the folder and
    when done, performs the loop function and onto the next file to repeat the process until all files are searched.  When completed, instead of running a cscript to execute the script and outputting the results to text, I am trying to create that as part
    of the overall script.  Saving yet another step for me to do.
    My current script is set to append to the same results file and will echo [name of file I am searching]:  No errors found.  Otherwise, the
    output shows the filename and the string text that matched.  Because the results append to it, I can only run the script against each file separately or create individual output names.  I would rather not do that if I could include it all in one.
     This would also free me from babysitting it and running each file script separately upon the other's completion.  I can continue with my job and come back later and view the completed report all in one.  So
    if I could perform this on an entire folder, then I would want the entries to include the filename, the line number that the match occurred on in that file and the string text that was matched (each occurrence).  I don't want the entire line to be listed
    where the error was, just the match itself.
    Example:  (In the event this doesn't display correctly below, each match, it's corresponding filename and line number all go together on the same line.  It somehow posted the example jumbled when I listed it) 
    File1.txt Line 54 
    Job terminated unexpectedly
     File1.txt Line 58 Process not completed
    File1.txt
    Line 101 User input not provided
    File1.txt
    Line 105  Process not completed
    File2.txt
    No errors found
    File3.txt
    Line 35 No tape media found
    File3.txt
    Line 156 Bad surface media
    File3.txt Line 188
    Process terminated
    Those are just random fake examples for this post.
    This allows me to perform analysis on a set of files for various projects I am doing.  Later on, when the entire search is completed, I can go back to the results file and look and see what files had items I wish to follow up on.  Therefore, the
    line number that each match was found on will allow me to see the big picture of what was going on when the entry was logged.
    I actually import the results file into a spreadsheet, where further information is stored regarding each individual text string I am using.  Very useful.
    If you know how I can successfully achieve this in one script, please share.  I have seen plenty of posts out there where people have requested all different aspects of it, but I have yet to see it all put together in one and work successfully.
    Thanks for helping.

    I'm sorry.  I was so consumed in locating the issue that I completely overlooked posting what exactly I was needing  help with.   I did have one created, but I came across one that seemed more organized than what I originally created.  Later
    on I would learn that I had an error in log location on my original script and therefore thought it wasn't working properly.  Now that I am thinking that I am pretty close to achieving what I want with this one, I am just going to stick with it.
    However, I could still use help on it.  I am not sure what I did not set correctly or perhaps overlooking as a typing error that my very last line of this throws an "Expected Statement" error.  If I end with End, then it still gives same
    results.
    So to give credit where I located this:
    http://vbscriptwmi.uw.hu/ch12lev1sec7.html
    I then adjusted it for what I was doing.
    What this does does is it searches thru log files in a directory you specify when prompted.  It looks for words that are contained in another file; objFile2, and outputs the results of all matching words in each of those log files to another file:  errors.log
    Once all files are scanned to the end, the objects are closed and then a message is echoed letting you know (whether there errors found or not), so you know the script has been completed.
    What I had hoped to achieve was an output to the errors.log (when matches were found) the file name, the line number that match was located on in that file and what was the actual string text (not the whole line) that matched.  That way, I can go directly
    to each instance for particular events if further analysis is needed later on.
    So I could use help on what statement should I be closing this with.  What event, events or error did I overlook that I keep getting prompted for that.  Any help would be appreciated.
    Option Explicit
    'Prompt user for the log file they want to search
    Dim varLogPath
    varLogPath = InputBox("Enter the complete path of the logs folder.")
    'Create filesystem object
    Dim oFSO
    Set oFSO = WScript.CreateObject("Scripting.FileSystemObject")
    'Creates the output file that will contain errors found during search
    Dim oTSOut
    Set oTSOut = oFSO.CreateTextFile("c:\Scripts\errors.log")
    'Loop through each file in the folder
    Dim oFile, varFoundNone
    VarFoundNone = True
    For Each oFile In oFSO.GetFolder(varLogPath).Files
        'Verifies files scanned are log files
        If LCase(Right(oFile.Name,3)) = "log" Then
            'Open the log file
            Dim oTS
            oTS = oFSO.OpenTextFile(oFile.Path)
            'Sets the file log that contains error list to look for
            Dim oFile2
            Set oFile2 = oFSO.OpenTextFile("c:\Scripts\livescan\lserrors.txt", ForReading)
            'Begin reading each line of the textstream
            Dim varLine
            Do Until oTS.AtEndOfStream
                varLine = oTS.ReadLine
                Set objRegEx = CreateObject("VBScript.RegExp")
                objRegEx.Global = True  
                Dim colMatches, strName, strText
                Do Until oErrors.AtEndOfStream
                    strName = oFile2.ReadLine
                    objRegEx.Pattern = ".{0,}" & strName & ".{0,}\n"
                    Set colMatches = objRegEx.Execute(varLine)  
                    If colMatches.Count > 0 Then
                        For Each strMatch in colMatches 
                            strText = strText & strMatch.Value
                            WScript.Echo "Errors found."
                            oTSOut.WriteLine oFile.Name, varLine.Line, varLine
                            VarFoundNone = False
                        Next
                    End If
                Loop
                oTS.Close
                oFile2.Close
                oTSOut.Close
                Exit Do
                If VarFoundNone = True Then
                    WScript.Echo "No errors found."
                Else
                    WScript.Echo "Errors found.  Check logfile for more info."
                End If
        End if

  • What is the best design pattern for multiple instrument​s?

    I have several PXI cards (DMM, O-scope, etc) that I want to create a master panel that can control all of the instruments individually, though not necessarily all at the same time (turn "instruments" on and off at will while the master vi continues to run).  Is there one design pattern (master/slave, producer/consumer, etc.) that works better than another for this type of master panel?  Are there other alternatives for this type of problem (VI Server, etc)?
    I was hoping that I could save a bunch of time if I could start on the right path right off the bat!
    Thanks,
    -Warren

    elrathia wrote:
    Hi Ben,
    I haven't much idea of how override works and when you would use it and why. I'm the newest of the new here. 
    Good. At least you will not be smaking with a OPPer dOOPer hammer if I make some gramatical mistake.
    You may want to look at this thread in the BreakPoint where i trie to help Cory get a handle on Dynamic Dispatching with an example of two classes that inherit from a common parent and invoke Over-ride VIs to do the same thing but with wildly varying results.
    The example uses a Class of "Numeric"  and a sibling class "Text" and the both implement an Add method.
    It is dirt simple and Cory did a decent job of explaining it.
    It just be the motivation you are looking for.
    have fun!
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Design Patterns for poor souls on LabVIEW Base

    Hi,
       I attempting to design an application which requires the use of the event structure. Unfortunatley, I only have LabVIEWBase, so need to invent the wheel somewhat. The architecture I am trying to develop needs to support a User interface with 30-40 controls, all with associated readand write buttons.
       When one of the values in controls changes I wish to execute a peice of code (assumably a state of a state machine). I also need some code to be executed when a read or set button is pressed.
       On top of all of this, I need the "quit" menu item to execute some code before quitting the application.
    Can anyone please help or suggest some archetecture? 
    Many thanks, Alec
    Solved!
    Go to Solution.

    We were developing large app s in LV well before the Event structure was introduced.
    We had to poll FP objects back then to determine if they changed state.
    The good news is you do ahve property nodes availabe so you could "divide and conquer" You could set-up sets of sub-VI's that accept a control ref and run there own loop watching for value changes. The change could be submited to a queue and then your GUI would read the queue (to see if anything changed) and based on the messages it receive act accordingly.
    So watchers combined with queues can be used as the "poor-man's Event Structure". Not as easy as an event structure but but functionally very similar.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Regular Expression for Match Pattern (string) Function

    I need to find a variable length string enclosed by brackets and
    within a string. Can't seem to get the regular expression right for
    the Match Pattern function. I'm able to get the job done using the
    Token function, but it's not as slick or tight as I'd like. Does
    anybody out there have the expression for this?

    Jean-Pierre Drolet wrote in message news:<[email protected]>...
    > The regular expression is "\[[~\]]*\]" which means:
    > look for a bracket "\[" (\ is the escape char)
    > followed by a string not containing a closing bracket "[~\]]*"
    > followed by a closing bracket "\]". The match string include the
    > brackets
    >
    > You can also read "Scan from String" with the following format:
    > "%[^\[]\[%[^\[\]]" and read the 2nd output. The brackets are removed
    > from the scanned string.
    Thanks, Jean_Pierre
    I did some more experimenting after posting and found that \[.*\] also
    works with the match pattern function. Thanks for your input.
    sm

  • What is the Scan from string pattern for "match everything" ?

    Hello,
    Using Scan from string for a while, I know that %s only matches string up to a whitespace. And I also thought %[^] would match everything including whitespaces. But it turned out that it would stop at the closing square brace.
    So, what is the real scan pattern for match everything including whitespaces ?

    What do you want the Scan From String to end on?  Or are you just grabbing the rest of the string?  If that is your scenario, then just use the "remaining string" output.  It might help if you give a full example of a normal input string and EVERYTHING you want as an output.

  • How to use multiple patterns for masking/format the input text

    Hi All,
    I am using Jdeveloper 11.1.1.5 and i have a requirement where i need to format my input Text value in these below patterns:-
    Format
    Example
    AA9A 9AA
    EC1A 1BB
    A9A 9AA
    W1A 1HQ
    A9 9AA
    M1 1AA
    B33 8TH
    A99 9AA
    AA9 9AA
    CR2 6XH
    DN55 1PT
    AA99 9AA
    For Example :-  If user puts value as EC1A1BB, it should automatically changed to EC1A 1BB
                                 if user puts value as W1A1HQ, it should be automatically changed to W1A 1HQ and so on..
    If it could have been one format , i might have followed this :- https://blogs.oracle.com/jdevotnharvest/entry/get_social_security_numbers_right
    But for multiple patterns i am not able to get through to the proper solution.
    Is there any way to achieve this ? Please suggest.
    Regards,
    Shah

    For the validation you should be able to use one regular expression where you add the logical or (|)  (check the doc http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html) between the groups. If none of the patterns matches you have an error.
    For the for formatting I'm not sure you can use only one expression.
    I suggest to write one method which does the checking on and the formatting may be using an array of patterns to check and iterate the patterns in a loop. Once you found a match you can read the needed format from another array (or an other dimension if you prefer to use a multidimensional array).
    Timo

  • How to search for a particular pattern in a string

    Hi,

    Hi ,
    How to search for a particular pattern in a string?
    I heard about java.util.regex; and used it in my jsp program.
    Program I used:
    <% page import="java.util.regex"%>
    <% boolean b=Pattern.matches("hello world","hello");
    out.println(b);%>
    I run this program using netbeans and am getting the following error message.
    "Cannot find the symbol : class regex"
    "Cannot find the symbol : variable Pattern "
    How to correct the error?

  • Split a string using Match Pattern function

    I am trying to split a response string from a climate chamber into different parts. The string goes something like this: 0030.0\s0034.6\s0080.0\s0083.4. I am using the match pattern function to split the string using \s as the search string. But it is not splitting the string as required. If I use only \ , its working fine. Can anyone please suggest why \s is not being recognised as a part of the input string?
    Subhro.
    Solved!
    Go to Solution.

    Is the string you show in normal display mode or in \ codes display mode?
    Anyway, if you need to match a '\' character you'll have to mask it using \, so the match string would be '\\s' to match '\s'.
    Alternatively you could use spreadsheet string to array with the correct delimiter. For the data you show this would work perfectly.

  • How to use regular expression using pattern and match concept for this scenario?

    Hi Guys,
    I have a string "We have 7 tutorials for Java, 2 tutorials for Javascript and 1 tutorial for Oracle"
    I need to replace the numbers based on the below condition.
    if more then 5, replace with many
    if less then 5, replace with a few
    if it is 1, replace with "only one"
    below is my code, I am missing the equating part to replace the numbers could any one of you please help me out fixing this.
    private static String REGEX="(\\d+)";
      private static String INPUT="We have 7 tutorials for Java, 2 tutorials for Javascript and 1 tutorial for Oracle";
      //String pattern= "(.*)(\\d+)(.*)";
      private static String REPLACE = "replace with many";
      public static void main(String[] args) {
      // Create a Pattern object
           Pattern r = Pattern.compile(REGEX);
        // Now create matcher object.
           Matcher m = r.matcher(INPUT);
           //replace the value 7 by the replace string
    //How to equate the (\\d+)  greater than a number  and use it the below code.
                  INPUT = m.replaceAll(REPLACE);
           //Print the final Result;
            System.out.println(INPUT);
    Thanks and Regards,

    Hi,
    Try the following which makes use of  "appendReplacement" instead with the "start" and "end" methods to locate and check the searched "regExp" string before dynamically setting the "replace" string:
    String regExp = "\\d+";
    String input = "We have 7 tutorials for Java, 2 tutorials for Javascript and 1 tutorial for Oracle";
    String replace;
    Pattern p = Pattern.compile(regExp);
    // get a matcher object
    Matcher m = p.matcher(input);
    StringBuffer sb = new StringBuffer();
    while (m.find()) {
       Integer x = Integer.valueOf(input.substring(m.start(), m.end()));
       replace = (x >= 5) ? "many" : (x == 1) ? "only one" : "few";
       m.appendReplacement(sb, replace);
    m.appendTail(sb);
    System.out.println(sb.toString());
    HTH.
    Regards,
    Rajen
    P.S: Please mark the post as answered/helpful if it resolves your issue for the benefit of all community members.

  • Match Pattern does not function properly when searching for a null character

    I'm using Match Pattern to extract a null terminated string from a response I'm getting from a device on a serial port. The VI is attached and below is a screenshot of the block diagram.
    It works just fine with index set to 0, 1, or 2. When index is 3, I get the output shown below.
    Why is Match Pattern not finding the null character?
    Thanks!
    Solved!
    Go to Solution.
    Attachments:
    Grab Nullterm String.vi ‏15 KB

    I'm a dope, need to remove the wire from the Offset control to the Match Pattern control.
    DUH!

  • Write REGEX for a string pattern

    Hi All,
    I am new to using regular expression and writing the patterns, I am looking to write a pattern for below formats and do a FIND REGEX:
    A123456-01-123456789-123   and A123456-01-123456789-ABC
    DATA: regex TYPE REF TO cl_abap_regex,
          res   TYPE        match_result_tab,
          text  TYPE        string.
    CREATE OBJECT regex
        EXPORTING pattern      = '\(.\)\1'
                  simple_regex = 'X'
    FIND ALL OCCURRENCES OF REGEX regex IN text RESULTS res.
    could you help me write the pattern to check if user has entered string in formats A123456-01-123456789-123   and A123456-01-123456789-ABC
    Thank you
    Depp

    Hi Manish,
    First of all sorry for getting back so late..was stuck with project delivery...and Thank you for your solution. Only one scenario failed i.e., I didn't mention that the value 01 in the examples, is constant in strings A123456-01-123456789-123   and A123456-01-123456789-ABC.
    which means it has to be always 01 any other value than 01 the sy-subrc should not be zero.
    I will also be thankful if you could share me the document(s) which help us write the above patterns( '^\w\d{6}-\d{2}-\d{9}-\d{3}$' ; '^\w\d{6}-\d{2}-\d{9}-\w{3}$' ).
    In the meanwhile I will also do some R&D with your reply to solve the failed scenario.
    Regards,
    Depp

  • How to find MATCH count for #  in a String

    Hi all,
    How to find MATCH count for #  in a String.
    Ex:  6170#0400-0002-00#API3PT#AL#AUST#DEVE#KG#100.00#100.00#100.00#0.00##10.20
    Regards,
    Balavardhan.K

    >
    balavardhan k wrote:
    > I have used below syntax to find count but it is not returning the value and SY-SUBRC  = 4.
    >
    >
    > Data : l_text type string.
    >
    > l_text = '6170#0400-0002-00#API3PT#AL#AUST#DEVE#KG#100.00#100.00#100.00#0.00##10.20'.
    >
    >
    > FIND ALL OCCURRENCES OF '#' IN L_TEXT MATCH COUNT mcnt .
    Then it's not a # but possible a horizontal tab-sign.
    Do a find on cl_abap_char_utilities=>horizontal_tab instead.
    Edited by: Maen Anachronos on Nov 23, 2010 2:48 PM

Maybe you are looking for

  • Automatic filling of form table-fields in the document

    Hi Gurus, We are working with sap RM on WAS640. In our Record Model we need to include a Word document that is to be used as a template. Inside the template we defined a table which has a fixed number of columns and one line which will be contains on

  • How can I get rid of the calendar icon that's showing on the top right of my screen?

    I can't figure out why the calendar icon is only showing when locked? When I unlock it it's not telling me I've missed anything and the icon isn't there so I can't figure out where's it coming from to delete it. Help! Solved! Go to Solution.

  • FCExpress VS FCP (quick answer please!)

    Hello, I'm a student in Digital Media at a design school, just finished a 2 month course involving FCP. I'm not financially able to purchase FCP, but Express is within my budget. What are the major differences between them? I cant find anything that

  • Reg. Stock account instead of consumption account

    Dear Experts Pls consider my below scenario When PR and PO creating material is posted to consumption account automatically,but our company needs to be posted stock account with account assignment category E. I am struggling for 6 months no one is gi

  • Looading issue in production?

    Hi, Actually every mid night one load will be triggered and it populates to a ODS.But this mid night the load which had triggered not completed its still in orange colour. The records transfered are 0-0.And I looked at the some earlier loads all of t