Usage of the xp20:matches() - String  function -reg

Hi,
Our current requirement is that if we receive the message that matches the pattern (Ie input starting with A to L) both inclusive(for eg : A123 , B567,... ,L890),we need to perform some routing in the mediator depending upon the message. I have tried to make use of the xp20:matches() function for checking the input, as per the dev guide.
Sample code used in filter expression in mediator:
<condition language="xpath">
<expression>xpath20:matches($in.request/cb1:singleString/cb1:input,'^[A-L]*$')</expression>
</condition>
Is there anything wrong in the usage of the matches function, as there seems to be some issues in the filter expression.
All the other logical functions and Startswith function seems to work well.
Any pointers would help.
Thanks
Swathy

Hi there,
If you want to match any word which starts with A-L character then use ^[A-L]
If you want to have exactly three numbers after first character (and nothing more) use ^[A-L][0-9]{3}$
Regards,
Milan
Edited by: 849823 on Apr 5, 2011 12:59 AM

Similar Messages

  • Whats happening internally within the unflatten from string function?

    I am getting unflatten from string error intermitently in my program. I can't post the program to get help but essentially I am storing a GOOP object reference as a string. The reference is flattened to a string and stored upon creation, at a latter time the string is then unflatterned to retrieve the reference and then the data. This works most of the time but occansionaly the unflatterned from string function fails. Prior to passing the string to the function I am checking that the string isn't null. I am assuming something else is corrupting the string prior to passing to this fucntion and would like to know what would trigger the error in the function as it may help me realise what is happening
    prior.
    Cheers,
    Wayne

    Hi,
    It really seems strange this problem, but one thing that might be the cause is how you store the flatten string. You do not mention that. I have once had problems when storing GOOP references as a sting and passing them between test VIs in TestStand using a string parameters in TestStand. A flatten string might have special chars that not all applications (such as TestStand parameters) can handle that and just trunkate the string when such a char is present, mistakenly inteprets that as end of string. Have you tried to check that string length is the same?
    However to make sure you get rid of all problems with string termination, you really should cast your GOOP reference into something else. I would instead cast the reference to an U32, or
    if you want, to solve the string problem for other types than GOOP reference, then flatten the type into string and then convert the string to an array of U8 before storing it. This would by sure solve your problem.
    Regards,
    Mattias Ericsson
    Endevo
    Sweden
    Main developer of the new GOOP2 and GOOP Wizard 3.
    PS! Have you seen that there is a new GOOP release that also may handle inheritance? Please check out: http://www.endevo.se/default.asp?lang=eng and click on "Products". There are examples, demos and white papers describing the new GOOP Inheritance Toolkit.
    Attachments:
    CastRefExample.vi ‏18 KB

  • Help on xp20:matches xpath function

    I have this xpath expression:
    xp20:matches(bpws:getVariableData('inputVariable','payload','/ns2:SmsInboxCollection/ns2:SmsInbox/ns2:message'),'\d+ \d+')"
    I always get this error (in BPEL's domain.log file):
    the reason is FOTY0001: type error. Please verify the xpath query.
    I am quite sure that "bpws:getVariableData('inputVariable','payload','/ns2:SmsInboxCollection/ns2:SmsInbox/ns2:message')" is a string based on the XSD.
    but a simple use of xp20:matches such as xp20:matches('123 123', '\d+ \d+') works fine!
    Can anyone let me know what I am missing?
    Mark

    Hi Mark,
    I have had the same problem with another xp20 function. My workaround was to store bpws expresion into an intermediate string variable and apply xp20 on it.
    Regars,
    amo

  • How to get the closest match strings

    Hello All,
    I am looking for a select statement that will compare the alphanumeric value of my input string and return the closest matching alphanumeric value from my Cache table.
    The Cache table has 2 columns.
    CREATE TABLE Cache (
    ID int identity primary key,
    SearchWord char(10)
    INSERT INTO Cache
    VALUES ('20');
    INSERT INTO Cache
    VALUES ('20A')
    INSERT INTO Cache
    VALUES ('20B')
    INSERT INTO Cache
    VALUES ('20A-1')
    INSERT INTO Cache
    VALUES ('20AB-223')
    INSERT INTO Cache
    VALUES ('20" Mainline')
    INSERT INTO Cache
    VALUES ('WEP3-SEG-1')
    INSERT INTO Cache
    VALUES ('WEP3-SEG-1A')
    INSERT INTO Cache
    VALUES ('WEP3-SEG-1B')
    INSERT INTO Cache
    VALUES ('WEP3')
    I am trying to use Difference function, but it is not working properly.
    select c.*,Difference(SearchWord, '20') from Cache c
    where SearchWord like '%20%' ORDER BY Difference(SearchWord, '20') DESC
    When I search for 20 in this table, I have to get all the closest matches i.e., 20, 20A,20B BUT NOT 20a-1,  20AB-223 and 20" MAINLINE and when I am searching for WEP3-SEG-1, I have to get WEP3-SEG-1, WEP3-SEG-1A but not WEP3 in the resultset.
    How can I achieve this?.
    Thanks for your assistance.

    Develop your own user-defined scalar difference function. You can name it udfDifference.
    BOL: Create User-defined Functions (Database Engine)
    UDF blog:
    http://www.sqlusa.com/bestpractices/training/scripts/userdefinedfunction/
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Database Design
    New Book / Kindle: Beginner Database Design & SQL Programming Using Microsoft SQL Server 2014

  • Is there a way to scan a string containing % (percent symbols) using the "Scan from String" function?

    I am communicating serially with a chilled mirror device and the input string syntax contains this text: "%RH=<input value>"
    I have not been able to figure out how to tell the function that the percent here is not a format specifier. Is this possible, or should I just try to use a different function?
    Thanks.
    Mitch
    Solved!
    Go to Solution.

    Use %% in your format string so that it knows to use the percent literally.  So %%RH=%f
    EDIT:  Darin got one in there ahead of me.  It looks like either \% and %% both work.
    Attachments:
    Example_VI.png ‏10 KB

  • Xp20:current-dateTime() function returning time 1 hour ahead

    Do anyone know if the xp20:current-dateTime() function is incorrect? It is returning time 1 hour ahead, for example: when executed and put into a database, the column shows 2007-08-28 13:46:54.0, but the ESB flow was executed at about 12:46pm.
    Any help would be greatly appreciated.

    Check the timezone setting on your DB and the App server OS. They must be on different zones.
    --Shiv                                                                                                                                                                                                               

  • How do I use the Match Pattern Function to exclude only 0.000?

    Hi,
    I'm trying to use the mattch pattern function to find the first string in a table thats is >0. My table looks like:
    1,0.000000,0.000 %2007/01/13 00:16:19 196281
    1,0.000000,0.000 %2007/01/13 00:16:22 196282
    1,0.831262,0.000 %2007/01/13 00:17:20 196375
    2,0.811154,0.000 %2007/01/13 00:17:20 196375
    If I us the paremeter "1,[~0]" It doesn't find the line 1,0.831262,0.000... which is the one that I want. I also tried :1,[0-9].+[~0] and that didn't work either. the problem is that the first digit after to 1, isn't allways going to go from 0 to 0.0 sometimes it might go from 0 to 2.??.
    Thanks for the help
    Matt

    "Matt361" <[email protected]> wrote in message news:[email protected]..
    Hi,
    &nbsp;
    I'm trying to use the mattch pattern function to find the first string in a table thats is &gt;0. My table looks like:
    1,0.000000,0.000 %2007/01/13 00:16:19 196281
    1,0.000000,0.000 %2007/01/13 00:16:22 196282
    1,0.831262,0.000 %2007/01/13 00:17:20 196375
    2,0.811154,0.000 %2007/01/13 00:17:20 196375
    If I us the paremeter "1,[~0]" It doesn't find the line 1,0.831262,0.000... which is the one that I want. I also tried :1,[0-9].+[~0] and that didn't work either. the problem is that the first digit after to 1, isn't allways going to go from 0 to 0.0 sometimes it might go from 0 to 2.??.
    &nbsp;
    Thanks for the help
    Matt
    &nbsp;
    Hi,
    1,[~0] matches a "1" a "," and then any character that is not "0".
    1,[0-9].+[~0] matches a "1" a "," and then any character that is "0-9", any number of anything!! (1 or more) and then anything that is not "0". Note that you have to escape a . to match a ".". Like this "\.".
    There is no way to check if there is anything other then a "0" in the match, from within the match pattern function. So I think you won't be able to find a pattern that does the trick.
    Why not use a whileloop to find the first item? Or use the Spreadsheet String To Array, and then compare the desired row or column with the string "0.000000"? (Or replace all ,0.000000, by a string like ",NULL,", then match the pattern?)
    In LabVIEW 8 there is a new Match Regular Expression function. Haven't tried it, but it should be much more powerfull then the Match Pattern function. But also much more complex.
    Regards,
    Wiebe.

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

  • 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

  • HT4913 i am trying to get my computer and my wifes computer on my itunes match.  i did the add a computer function and it says that this computer is already associated with an apple id...if you use itunes match with your apple id etc for 90 days...please

    i did the add a computer function and it says that this computer is already associated with an apple id...if you use itunes match with your apple id etc for 90 days...please explain.  is this going to screw my wifes account up? 

    If you both have seperate iTunes Store accounts then basically, yes, it is going "screw up" your wife's account.
    iTunes Match is designed as a single-user service which is associated with one and only one iTunes Store account ID. If you have subscribed on your account and want to activate the service on another computer that is already signed in with an account the present account must be signed out and then iTunes signed into your account. This means the other computer will have complete access to your account and will only be able to make purchases on your account. iTM is not designed to be signed in and out at will. If she has apps purchased with her iTunes Store account they will not be able to be updated.

  • 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 will the itunes match app affect my data usage?

    how will the itunes match app affect my data usage? It seems to take a while to connect and start playing so i'm assuming if my range isnt the best it will drop out like a bad radio station???

    What I have done is create playlists and I'll download the playlists to the iPhone while I'm at home, on Wi Fi, and listen while I'm out and about. I've only downloaded the occasional tracks on 3G (mainly because at&t's network was so terrible). This method worked pretty well for me.
    Incidentally, iTunes Match should not be used as a substitute for a backup: FAQ:  Why iTunes Match can NOT be used as a backup!

  • Match hex 00 or NULL with Match pattern function

    Hi, I am using Match pattern funciton to match NULL character and 0000 character in a string (hex display).
    Someone told mu use the following regular expression:
    ^[\00]*, and [\00]*$ , and he said:
                    \00 is Hex 00
                    \0 un-defined
    But I read some stuffs about regular  expression that \0x00 is Hex 00, \00 is Octal 000.I want to know what meaning the \00 is.
    Please refer to the attached trim00.vi.
    Solved!
    Go to Solution.
    Attachments:
    trim00.vi ‏7 KB
    trim00.vi ‏7 KB

    Match Pattern and Match Regular Expression are two different functions. With Match Pattern the string ^[\00]* matches any number of null characters starting at the beginning of the string, while the string [\00]*$ matches any number of null characters starting at the end of the string. Check the help for the Match Pattern function for more info.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Utility library error string function?

    I've been working on an Error Handler library, culled mostly from these wonderful fora (Roberto!).  I can't seem to find an error code string generator for the functions in the Utiltiy Library though (in particular, functions like RenameFile, CopyFile, GetDir, SetDir, MakeDir, all the file i/o functions).
    Most of those make mention to negative error types with some plain text explanations.  But there's no mention of a nice code-to-string converter function, as there is in other libraries.  For instance, for the RS232 library, there is GetRS232ErrorString.  For the Formatting & I/O library, there is GetFmtIOErrorString.
    Am I not seeing it somewhere?  Inside the Utility library, there is a multithreading error code function called CmtGetErrorMessage.
    Solved!
    Go to Solution.

    You're right: the Urility Library does not incorporate a function that translates error codes to a meaningful text. I suppose this is due to the fact that error codes partly overlap, so a unique function could not be used.
    Just as an example, error -1 means File not found in almost all file I/O library functions, but it translates to No files found matching the search criteria in GetFirstFile () , to No more files in GetNextFiles () and Invalid Parameters in MakePathname ().
    Another example: error -2 means GetFirstFile must be called before if returned by GetNextFile (), and Resulting pathname too long if returned by MakePathname ().
    And this considering only File I/O section of the library!
    While developing my own toolbox of utilities, I have created the following function, which I know is far from perfect and covers only file I/O functions:
    char * CVIFUNC GetULibFileIOErrMsg (int error)
    // Messages associated to error codes returned by functions in File Utilities class in Utility Library
    switch (error) {
    case 0: return "Success";
    case -1: return "One of the path component not found";
    case -2: return "Resulting pathname longer than 260 chars";
    case -3: return "General I/O error occurred";
    case -4: return "Insufficient memory to complete operation";
    case -5: return "Invalid path";
    case -6: return "Access denied";
    case -7: return "Specified path is a directory, not a file";
    case -8: return "Disk is full";
    case -9: return "New file already exists";
    default: return "Unknown error";
    return NULL;
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • What is the difference between String Constant and Empty String Constant

    What is the difference between string constant which does not contain any value and the Empty string constant?
    While testing a VI which contain a normal string constant in VI analyzer, it gives error to change string constant with the empty string constant?
    Please Reply
    prabhakant
    Regards
    Prabhakant Patil

    Readability.
    Functionally, they are the same. From a coding standpoint, the Empty String Constant is unambiguous.
    It is empty and will always be; good for initialization. Also, because you can not type a value into and Empty String Constant, someone would need to conciously replace it to set a 'default' value that is something other than NULL.
    Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
    If you don't hate time zones, you're not a real programmer.
    "You are what you don't automate"
    Inplaceness is synonymous with insidiousness

Maybe you are looking for