ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Match Pattren Problem

Solved!
Go to solution

Hello,

i am using Match pattern String Function in Labview to Search the String. the Problem i am getting is Say i have strings in the order

 

ABC

Test1

Test

 

 

If i give Test has Regular Expression to Match, i am getting Matched Output for Test1 , i mean Before Substring is  ABC, Match Substring is Test and After Substring is 1 Test.  i am lookinh for the 3rd line. i dont have any commas or dot in the end of the string. Please help

0 Kudos
Message 1 of 4
(3,429 Views)

I would probably use Match Regular expression in this case.  Use the regex 'Test\b' which matches the string 'Test' followed by a word boundary (space, end of line, end of string, etc.).  

0 Kudos
Message 2 of 4
(3,401 Views)
Solution
Accepted by KiranKeshavegowda

Well you could have the search look for "Test\n" or "Test\r\n" depending on your format.  Then you'll match on a string that has a line that ends in "Test".  Of course this would only work if Test is not the last line in the file.

 

But yeah regular expression would probably be easier.

0 Kudos
Message 3 of 4
(3,362 Views)

Hello All,

 

thanks for the Help.

 

Kiran

0 Kudos
Message 4 of 4
(3,257 Views)