|
From: altenbach on 6 May 2008 11:40 Here's a quick draft that would do the current problem. <img src="http://forums.ni.com/attachments/ni/170/321431/1/lexicalClass.png"> Message Edited by altenbach on 05-06-2008 08:34 AM lexicalClass.png: http://forums.ni.com/attachments/ni/170/321431/1/lexicalClass.png
From: craigc on 6 May 2008 12:10 Ahh Quite handy to know, Thanks
From: altenbach on 6 May 2008 13:40 tst wrote: I never thought I would live to see the day where Altenbach suggests a loop (with a resizing operation, no less) as the simpler solution to a single primitive. :smileyvery-happy: Hey!!! :D Yes, the loop can be done essentially in-place by re-using the input array with a little bit more code. Yes, the primitive is probably a more natural choice, but it requires fancy knowledge to compose the pattern string. ;) The purpose of my post was more educational to draw attention to the "lexical class" primitive. Most people have never seen it. :) It can be useful. Performance wise, the "search and replace all" is a multipurpose VI and the parsing and matching is probably more expensive than the lexical class, which could be implemented as a simple 8bit lookup table. I have not done any benchmarks though. :)
From: altenbach on 7 May 2008 10:10 smercurio_fc wrote: Maybe he really, really dislikes regex expressions. :smileyvery-happy: I think you are on to something here! It is true that I use these things rarely enought that I always need to consult the help screen. As soon as I need anything fancier, I never get things right on the first try. One reason I like LabVIEW is the fact that it is graphical and does not require any verbal syntax constructs. Any regex throws me back to the old text based code in some way. :D
From: smercurio_fc on 7 May 2008 10:10 :smileyvery-happy: :smileyvery-happy: That's exactly the same way I react whenever I have to use those regex expressions. I invariably have to crack open the full LabVIEW Help file to get those right.
First
|
Prev
|
Next
|
Last
Pages: 1 2 3 Prev: Create Array From Listbox Event Next: GPIB Read in LabVIEW 7.01 |