10-15-2010 08:42 AM
Hi All!
I will avoid text based solutions but after looking at my code, I thought I may get a chance to learn a better way to do this.
Problem:
In LV 8.6 there is an issue where a particular "node' in a VRML file will result in LV crashing if I attempt to open a file that contained that node.
Solution:
Wirte code to check the file and remove the bad "node" beforea attempting to open it.
SO this code works but screams "Could this be done better using Reg Expresions?"
I think the picture tells the rest of the story.
NOTE: The non-visalbe cases just pass the wires through.
SO share your thoughts please.
Ben
Solved! Go to Solution.
10-15-2010 10:09 AM
I'm not the regex guy, but this topic looks like it should at least be cross-referenced in the "Regular Expresions Board" topic.
http://forums.ni.com/t5/BreakPoint/Regular-Expressions-Board/td-p/1187799
I just tweeted about this topic because of a post on LAVA regarding using regex to process HTML. It seems regex is popular lately...
10-15-2010 10:31 AM
Read this regex like:
10-15-2010 10:48 AM
10-15-2010 11:28 AM
Even better than my original. This one finds the beginning of the selection followed byeverything up to the first "}" (and line feed).
Kudos to ben64 for the hint.
10-15-2010 11:31 AM
My Rube reduced to 22 characters...
Where is that embarased emoticon?
Ben
10-15-2010 01:20 PM - edited 10-15-2010 01:22 PM
First, it is great that you are going to use Search and Replace with Regular Expression selected and not some string gymnastics to remove those sections.
<plug type="shameless">
Second, if you are looking to hone your regex skills without having to memorize a bunch of special codes, check out the example I posted for the current contest.
http://decibel.ni.com/content/docs/DOC-13698
</plug>