LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Regular expression != regular expression?

Solved!
Go to solution

@alexderjuengere wrote:

often, I use  the regex modus of the function "search and replace string" instead of match pattern.


I did a quick test and switching that on or off is very similar to Match pattern/Regular expression in speed. It seemed to be slightly faster as you only create one output.

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 11 of 14
(3,005 Views)

I still use the Match Pattern function regularly. It’s already complex enough that I have to consult the context help anyhow but not as complex as PCRE which usually creates a knot or two in my brain cells. And there is a performance advantage too: The PCRE function is generally slower.

 

As it is also said: I had a problem and used PCRE to solve it. Now I have two problems!

Rolf Kalbermatter
My Blog
Message 12 of 14
(3,005 Views)

Additional note on the different between these two:

 

"Match regular expression" is actually an Xnode.

 

Darren has a post with a video posted here, in which it is explained that use of Xnodes is on occasion the cause of some weird LabVIEW problems (the section on Xnodes starts a little bit after 10 minutes in).

 

As such, if you do need to match a regular expression that isn't usable with the "Match Pattern" limited inputs, instead of using the built-in "Match regular expression", you can use this VI instead without the need for an Xnode:

 

\vi.lib\regexp\Match Regular Expression_Execute.vi

 

It returns the values found as an array instead of as individual outputs on a resized "Match regular expression" node, but is otherwise a completely equivalent function call with less overhead and does not invoke an Xnode.

Message 13 of 14
(2,971 Views)

@Kyle97330 wrote:

Additional note on the different between these two:

 

"Match regular expression" is actually an Xnode.

 

Darren has a post with a video posted here, in which it is explained that use of Xnodes is on occasion the cause of some weird LabVIEW problems (the section on Xnodes starts a little bit after 10 minutes in).

 

 

As such, if you do need to match a regular expression that isn't usable with the "Match Pattern" limited inputs, instead of using the built-in "Match regular expression", you can use this VI instead without the need for an Xnode:

 

\vi.lib\regexp\Match Regular Expression_Execute.vi

 

It returns the values found as an array instead of as individual outputs on a resized "Match regular expression" node, but is otherwise a completely equivalent function call with less overhead and does not invoke an Xnode.


Sounds like they implemented this idea (although it's in LV13, and the idea is 2017 😋😞

 

Add Match Regular Expression sub VI - NI Community

 

My VI returns offsets too (of the 'goups' 🙄), and the implementation is a bit nicer, if I can say so myself...

 

A benefit of an XNode (any inlined code) is that dead code actually gets removed. So the wired inputs and outputs of the XNode can actually have an impact on performance.

0 Kudos
Message 14 of 14
(2,896 Views)