LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with the $ sign by Match String

Hi!
 
I'm trying to cut out the information from NMEA sentences with LabVIEW 8.2
The first sign in each sentence is $ the last two are <CR> and <LF>.
So I tried to use Match Pattern.vi to cut out all between these signs (s. small vi in attachment).
The problem is the Match Pattern.vi just can't recognize the $ sign!
 
Thank you in advance!
 
Dimitri Karch
0 Kudos
Message 1 of 4
(2,664 Views)

The $ sign is a special character in a regular expression and has a particular meaning.  When you specify the regular expression to search for, use \$.

I tried it and all of your methods work.

 

S G
Certified LabVIEW Architect, Certified TestStand Architect, Certified Professional Instructor
0 Kudos
Message 2 of 4
(2,663 Views)
Take a look at this attachment.
 
In a regular expression, $ means end of string. 
 
If your input string is dogcatdogcat and your regular expression is cat, then the matched string is the first cat in the input string.  If your regular expression is cat$, then the matched string is the second cat.
 
So, when you tried to match the regular expression $, you were trying to match to an empty string at the end, which is why your function failed.  When you enter \$, the regular expression treats the $ as a character.
S G
Certified LabVIEW Architect, Certified TestStand Architect, Certified Professional Instructor
Message 3 of 4
(2,661 Views)

THANK YOU!!!!!!!!!!!!

It realy works! Thank you!

0 Kudos
Message 4 of 4
(2,643 Views)