ā03-09-2026 01:08 PM
I'm not getting what I expect and I don't see my error here.
I have some strings that, near the end, have a space followed by an "L" or "R" then a period.
I want to insert some text just before the "L" or "R". Here's what I using"
I'm expecting "prefix added L.tif" but I'm getting "prefix added $1.tif"
What am I doing wrong?
Solved! Go to Solution.
ā03-09-2026 01:24 PM - edited ā03-09-2026 01:27 PM
ā03-10-2026 12:30 PM
If you haven't used it before, try out regex101.com. The "explanation" tab over on the side is a huge help.
For example, inputting your regex showed it's looking for the () characters, and has no capture groups:
Using Raphaƫl's regex shows it dropped the () and gave you a capture group:
I also use the "Quick Reference" section all the time, because I can never remember the lookahead/lookbehind/other random stuff syntax.
ā03-11-2026 09:17 AM - edited ā03-11-2026 09:18 AM
I use rubular.com for my RegEx validations.
ā03-14-2026 12:28 PM - edited ā03-14-2026 12:32 PM
I'd include the . in the capturing group:
Probably also the space:
Probably remove excessive spaces:
ā03-14-2026 07:07 PM
ā03-19-2026 03:29 AM
@raphschru wrote:
I'd personally use a positive lookahead to have the replace string contain exactly what I want to insert:
I never remember the syntax of those look arounds when I need them, so I don't use them unless I have to. They are quite powerful..
ā03-19-2026 04:38 AM
wiebe@CARYA wrote:
@raphschru wrote:
I'd personally use a positive lookahead to have the replace string contain exactly what I want to insert:
I never remember the syntax of those look arounds when I need them, so I don't use them unless I have to. They are quite powerful..
I often go to https://regex101.com/.
The Quick Reference section is wonderful for finding the syntax I need.
ā03-20-2026 03:23 AM - edited ā03-20-2026 03:25 AM
@raphschru wrote:
wiebe@CARYA wrote:
@raphschru wrote:
I'd personally use a positive lookahead to have the replace string contain exactly what I want to insert:
I never remember the syntax of those look arounds when I need them, so I don't use them unless I have to. They are quite powerful..
I often go to https://regex101.com/.
The Quick Reference section is wonderful for finding the syntax I need.
I have a copy of O'Reilly Python Pocket Reference (9781449357016). 2,- EU at a thrift shop.
It has 2 paragraphs that summarize everything about reg.ex.'s.
I don't use it for anything else (since it's about Python).
I do miss a few things Python can do, like calling custom functions from a reg.ex.. That would be very powerful, for things like capitalizing start of words, or incrementing numbers, etc.. These things require loops, cases and shift registers in LabVIEW. I suppose LabVIEW could do that by providing a (array of) (strong typed) VI server input... But the only way I see it happening is if we make it and show it off to NI.
ā03-20-2026 04:37 AM - edited ā03-20-2026 04:49 AM
wiebe@CARYA wrote:
@raphschru wrote:
wiebe@CARYA wrote:
@raphschru wrote:
I'd personally use a positive lookahead to have the replace string contain exactly what I want to insert:
I never remember the syntax of those look arounds when I need them, so I don't use them unless I have to. They are quite powerful..
I often go to https://regex101.com/.
The Quick Reference section is wonderful for finding the syntax I need.
I have a copy of O'Reilly Python Pocket Reference (9781449357016). 2,- EU at a thrift shop.
It has 2 paragraphs that summarize everything about reg.ex.'s.
I don't use it for anything else (since it's about Python).
I do miss a few things Python can do, like calling custom functions from a reg.ex.. That would be very powerful, for things like capitalizing start of words, or incrementing numbers, etc.. These things require loops, cases and shift registers in LabVIEW. I suppose LabVIEW could do that by providing a (array of) (strong typed) VI server input... But the only way I see it happening is if we make it and show it off to NI.
C callbacks for PCRE callouts and many other things would be a great feature. If you write it in the IDEA exchange, I will vote for it.
There might be some more complicated ways, but for me it would be enough if the Call Library Function Node (CLFN) configuration dialog box provides a parameter type pointer to function" which allows the selection of a DLL (library name or path) and the name of the function. This yould allow to create a DLL/DLL function with LabVIEW an use that function for the callback. Soemthing like this...
ā
ā
(Update: changed picture)