03-20-2026 04:42 AM
wiebe@CARYA wrote:
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.
I found a regexp that can capitalize words, but LV doesn't support \u ...
03-20-2026 05:05 AM
@Yamaeda wrote:
wiebe@CARYA wrote:
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.I found a regexp that can capitalize words, but LV doesn't support \u ...
PCRE and PCRE2 don't support the Perl \u escape sequence.
from PCRE2 documentation:
Unsupported escape sequences
In Perl, the sequences \F, \l, \L, \u, and \U are recognized by its string handler and used to modify the case of following characters. By default, PCRE2 does not support these escape sequences in patterns. However, if either of the PCRE2_ALT_BSUX or PCRE2_EXTRA_ALT_BSUX options is set, \U matches a "U" character, and \u can be used to define a character by code point, as described above.
03-20-2026 11:55 AM
@Martin_Henz wrote:
@Yamaeda wrote:
wiebe@CARYA wrote:
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.I found a regexp that can capitalize words, but LV doesn't support \u ...
PCRE and PCRE2 don't support the Perl \u escape sequence.
Spoilerfrom PCRE2 documentation:
Unsupported escape sequences
In Perl, the sequences \F, \l, \L, \u, and \U are recognized by its string handler and used to modify the case of following characters. By default, PCRE2 does not support these escape sequences in patterns. However, if either of the PCRE2_ALT_BSUX or PCRE2_EXTRA_ALT_BSUX options is set, \U matches a "U" character, and \u can be used to define a character by code point, as described above.
@Martin_Henz wrote:
@Yamaeda wrote:
wiebe@CARYA wrote:
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.I found a regexp that can capitalize words, but LV doesn't support \u ...
PCRE and PCRE2 don't support the Perl \u escape sequence.
Spoilerfrom PCRE2 documentation:
Unsupported escape sequences
In Perl, the sequences \F, \l, \L, \u, and \U are recognized by its string handler and used to modify the case of following characters. By default, PCRE2 does not support these escape sequences in patterns. However, if either of the PCRE2_ALT_BSUX or PCRE2_EXTRA_ALT_BSUX options is set, \U matches a "U" character, and \u can be used to define a character by code point, as described above.
But I think \U sets case sensitivity.
That's not enabling replacing all a -> A, or 1 -> one.
An inlined function would be able to do that.
import re
def uppercase(match):
text = match.group(1)
return text.upper()
pattern = r"<b>(.*?)</b>"
text = "This is <b>bold</b> text."
result = re.sub(pattern, uppercase, text)
print(result)
03-22-2026 03:03 PM
This example with uppercase/lowercase can be done entirely by PCRE2.
Yes, of course, I still needed a few hours now, because my PCRE2 library was not yet ready to be able to demonstrate that and that package is still a few hours away from release.
Much more complicated changes are, however, not possible with PCRE2 alone.
03-23-2026 12:47 PM
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.
OpenG libs have LabVIEW native functions for capitalizeing, etc...
OpenG String Library Toolkit for LabVIEW - Download - VIPM by JKI