LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to eliminate lines from string

Solved!
Go to solution

@AdamKemp wrote:
... The full syntax for PCRE is very large and complex, and it supports many obscure features that most users will never need. As a result we deliberately chose not to document the full set of features supported by the syntax. If we had done that we would have ended up with a very large document that is difficult to maintain and simply overwhelming for the majority of users (a counterproductive result). Instead we chose to document only the most important and commonly used parts of the syntax....

The LV documentation (IMO) is woefully inadequate, and barely portrays the advantages of regex over the LV match pattern functionality.

 

The referenced site to the full documentation is only slightly better as an ascii dump of the unix man pages is not so nice.  Buried in there is the desired man page (pcresyntax).  This brief overview is very useful, and by the time it is pared down by removing unsupported and barely used features the result is not so large nor so hard to maintain.  See the attached file for my quick pass.  This could be the basis for more useful documentation built into LV.  Add a few hyperlinks and you are good to go.  POSIX classes could go, but I like them so I chose to leave them in.

Message 11 of 19
(1,016 Views)

I use regular expressions quite frequently (and I was the one implemented this feature in LabVIEW), and I rarely write regular expressions which use more than the features mentioned in the documentation. Once you know how to use character classes ("[a-z]"), alternates ("cat|dog"), and repetition ("(foo)*", as well as + and {...}) you can already handle most use cases.

 

I realize there are many more things you can do with this syntax, and some people like to use those other features more often than others, but our goal is to keep the documentation as understandable as possible while covering the most important parts for the major use cases. I don't want to try to include comprehensive documentation on the entire syntax available.

 

If there are specific pieces of syntax which you feel are very important and are not covered then feel free to make a case for adding that, but try to keep in mind the principles I just described.  

Message 12 of 19
(1,007 Views)

Boy that escalated quickly!

 

But I appreciate your feedback very much, you guys always provide excellent answers. Im gonna test the solutions before i accept any answers as solutions but i suspect it will work out nicely.


0 Kudos
Message 13 of 19
(991 Views)

Darin K.  That trick was sweet! works nicely! 

I used jarcarmody's expression to extract values from the text file as well.. But i need a little expanding on it.

Imagine that i a file containing several of these "command, value= >>some value<<". how would i identify the entire set of values? I know that i could place multiple "Match regular expression" blocks and connect them through the "after match out" but that would limit my ability to identify values to the number of block that i connected, and that is inconvenient.


Kind regards and thank you so far

Atamsih

0 Kudos
Message 14 of 19
(972 Views)

@Atamsih wrote:

[...] Imagine that i a file containing several of these "command, value= >>some value<<". how would i identify the entire set of values? [...]


Example_VI.png

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 15 of 19
(951 Views)

I am not sure that back-saving a snippet with a LV12 feature is going to end well.

0 Kudos
Message 16 of 19
(948 Views)

@Darin.K wrote:

I am not sure that back-saving a snippet with a LV12 feature is going to end well.


I am not sure that I'm not the only person there are many people that can extract a snippet in LV8.2.

 

I dropped it onto a LV12 BD and got this (after a Clean Up Diagram):

 

Example_VI_BD.png

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 17 of 19
(938 Views)

Definitely one of the most wide ranging and interesting threads in quite some time!

 

Back Saved Snippet:

LV12 & LV10 : Recreates without tunnel and with added bug (uninitialized SR)

LV9 : Error 6, cannot load BD

 

Back Saving VI Itself:

LV10 : No bug this time.

LV9: Same Error

Message 18 of 19
(929 Views)

Guys thank you so much! 

The code inputs really helped .. although the perl discussion was beyond my understanding i appreciate all the inputs.

kudos given and solution accepted!

0 Kudos
Message 19 of 19
(881 Views)