LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Match Pattern - non-printable characters in input string ...

Hi Folks,
 
Will someone please confirm that Match Pattern is not supposed to work correctly with "binary" strings? Smiley Surprised
 
I wanted to match a single \FF with no \FF before or after, and this regular expression: [^\FF]\FF[^\FF] seemed to work, however, the code was failing to match the \FF in:  "\11\0A\FF\22".  Further experimenting seems to suggest any of the "non-printable" characters before or after \FF will cause the match to fail. Smiley Sad
 
If this is by design, it would be good to see some kind of warning in the help for "Match Pattern".  LV 8.2 help says it "Searches for regular expression in string" - isn't a "String" any array of bytes?
 
Cheers!
 
P.S. Also found this - with no NI follow-up.
 
 
"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
0 Kudos
Message 1 of 3
(2,365 Views)
Tested with LV 7.1. It works using ~ (126) instead of ^.
~ allows for non printable characters.
Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
Message 2 of 3
(2,356 Views)

Smiley Tongue

Thanks Paolo.

"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
0 Kudos
Message 3 of 3
(2,335 Views)