LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

search and replace pattern (string) not -1 when not found

Solved!
Go to solution

Hey,

when using the 'search and replace pattern' for string with input string "0" searching for ".", past offset output returns 1 (and not -1).

 

0 Kudos
Message 1 of 4
(2,734 Views)

Hi kd,

 

it always helps to provide an example VI to demonstrate the problem:

check.png

So what's the problem?

 

Btw. as there is no "search and replace pattern" I took SearchAndReplaceString instead…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 4
(2,732 Views)

Hey Gerd,

I assume Your example is not from NXG environment, but lv2017 or earlier.

I have attached a snapshot of my screen now.

thx & regards,

Koen.

0 Kudos
Message 3 of 4
(2,722 Views)
Solution
Accepted by kdCMC

I'm going to take a guess that you're using Match Pattern and passed in "." instead of "\.".

"." is a special character for regex matching so it needs to be escaped.

Message 4 of 4
(2,721 Views)