regular expression or string (nevermind) format

Resolved,

I can use the string to a fractional number!

Hello

I have an array of strings in a multicolumn list box 2D, and I want to check if each value is a valid number, numbers can be one and can have negative values. Anyone know what regular expression, I need to check it out, or there at - it a still better way?

Best regards

Thijs

solved!

Tags: NI Software

Similar Questions

  • Multiline - Regular Expression Match string

    I'm trying to understand the format of a regular expression to pull select off multi-line string lines and fill in these lines as the individual elements of an array of strings using regular expressions to Match. The total length of the multiline string may vary as well as the text in the string. The string can contain letters, numbers and special characters. I've attached an example VI. In the example of VI, I want to only return lines starting by "device #" in the table. The number of lines starting by "device #" can vary, but I want to capture them all.

    Or is there a better functioning to be used instead of the corresponding regular Expression that will give me the desired result?

    aaronb wrote:

    I'm trying to understand the format of a regular expression to pull select off multi-line string lines and fill in these lines as the individual elements of an array of strings using regular expressions to Match. The total length of the multiline string may vary as well as the text in the string. The string can contain letters, numbers and special characters. I've attached an example VI. In the example of VI, I want to only return lines starting by "device #" in the table. The number of lines starting by "device #" can vary, but I want to capture them all.

    Or is there a better functioning to be used instead of the corresponding regular Expression that will give me the desired result?

    Corresponding regular expression works well for this.

    Ben64

  • Another question about regular expressions with String.matches

    don't match String.matches () method expressions when a substring of the string matches, or must match the whole string? So if I have the string '123ABC', and I ask match "1 or more letters" will be it fail because there are other that the letters in the string, but then spend if I add "1 or more letters AND numbers 1 or more? Thus, in the second case each character in the string is recorded in the research, as opposed to the first. Is that correct, or are there ways to JUST matching a substring in the string instead of all this? I'll do some examples too... but that makes sense?

    It must match the entire string. Use Matcher.find () to match on just a sub-string)

  • Need help with regular Expression (RegEx)

    Try to wrap your head around a regular Expression for the following format example: 0022-C-4452 OR 0022-C-4452-C


    * The 4 digits are always numbers

    * The last 5 digits are alpha numeric

    * Last (if used) digit is always 'C' (in reference to the second structure)

    Hold the dashes for "auto fill" if possible? This would be in the Custom Format? Sequence of keys? Or Validation? I appreciate any help!

    I still think that you did not correctly describe your problem.

    1 figures of 4 characters.

    Optional separator.

    Then 6 alphanumeric characters and ' - '.

    OR

    1 figures of 4 characters.

    Optional separator.

    Then 6 alphanumeric characters and ' - '.

    Optional separator.

    Character 'C '.

    Note that the "-" is not a number and not an alphabetic character. It is a white space character.

    Try:

    function {MyRe (cString)
    var cFormatted = "";
    var RE_MyCode0 = /^(\d{4})[-.]) {0,1} ([A-Za-a0 - 9-] {6}) $/;
    var RE_MyCode1 = /^(\d{4})[-.]) {0,1} ([A-Za-a0 - 9-] {6}) [-.] {0,1} ([C]) $/;
    If (RE_MyCode0.test (CString) == true) {}
    cFormatted = RegExp. $1 + '-' + RegExp. $2;
    }
    If (RE_MyCode1.test (CString) == true) {}
    cFormatted = RegExp. $1 + '-' + RegExp. $2 + '-' + RegExp. $3;
    }
    Return cFormatted;
    } / / end of MyRe function;

    some tests;
    var MyString = "0022-C-4452; good channel;
    Console.println ("Input:" + MyString);
    Console.println ("result:" + MyRe (MyString));

    var MyString = "0022-C-4452-C; string of Goo;
    Console.println ("Input:" + MyString);
    Console.println ("result:" + MyRe (MyString));

    var MyString = "A022-C-4452" / / bad string;
    Console.println ("Input:" + MyString);
    Console.println ("result:" + MyRe (MyString));

    var MyString = '0022-4452-CZ' / / bad string;
    Console.println ("Input:" + MyString);
    Console.println ("result:" + MyRe (MyString));

  • 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'