08-18-2009 09:57 AM - edited 08-18-2009 10:01 AM
Now in its new home. For those of you who haven't ventured over to Breakpoint, I'll repeat the premise of this thread.
Reminiscent of the "Word of the Day" calendars, I will choose a function or structure or VI and you can:
1) Look at the context help (extra credit for reading detailed help)
2) Use it in a simple VI (use all connectors)
3) Explore the behavior with different inputs, does it accept arrays (1D,2D), different inputs, try to find interesting behaviors
If you are one of those users that have used every function and structure that comes with LV, then feel free to chime in about why a certain item should or should not be useful in our daily lives. Any gotchas we should be aware of. Cool tricks?
If you are an advanced user, perhaps there are some functions that you haven't had occasion to use, or perhaps there are new ways to solve old problems.
If you are a beginner, feel free to post questions/comments. I hope you learn two things, how to use the context help and perhaps a new VI or two.
The function to use today is "Match Pattern"
With the advent (or at least my discovery) of functions such as String to Spreadsheet Array and Scan String for Tokens I use this one a lot less than I used to. But with the flexibility of the special characters, this is a very versatile function. For example, you can easily separate a number at the decimal point:
(Hint for newbies to this thread: I am probably trying to trick you)
08-18-2009 10:35 AM - edited 08-18-2009 10:36 AM
Let see who can spot the issue with that code.
See also here for an old Nugget that mentions a code construct that could increase searches for string patterns by a factor of 8 (in older version of LV).
Ben
08-18-2009 11:49 AM - edited 08-18-2009 11:51 AM
Hmm, that gives a strange result.
Using a period for the match:
Using a different character:
The second case is generally the expected result.
To be honest, I dont know why it does that
My only guess is the fact that it is a period.
When you search for abc*, it treats the asterisk as "any other characters".
Maybe the period is being treated in the same way?
So the first character will be treated as the match?
08-18-2009 11:55 AM
After you read the detailed help it makes perfect sense, right?
Unless you happen to be one of about three people, I'll bet you would have made the same mistake the first time....
08-18-2009 11:57 AM - edited 08-18-2009 11:59 AM
That's why someone wrote a "detailed help"
This is the correct syntax for the "match string"
Edit: I was coding while Darin was typing 🙂
08-18-2009 05:24 PM - edited 08-18-2009 05:31 PM
This should give some insight into the website named Slashdot...
It's also worth noting, in the Advanced Help, that Match Regular Expression uses a larger subsut of regular expressions but is slower than Match Pattern.