02-02-2024 08:52 AM
@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.
02-02-2024 08:55 AM - edited 02-02-2024 08:56 AM
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!
02-02-2024 12:36 PM
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.
02-05-2024 03:29 AM - edited 02-05-2024 03:34 AM
@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.