02-15-2012 11:14 AM
Hi, I am using Match pattern funciton to match NULL character and 0000 character in a string (hex display).
Someone told mu use the following regular expression:
^[\00]*, and [\00]*$ , and he said:
\00 is Hex 00
\0 un-defined
But I read some stuffs about regular expression that \0x00 is Hex 00, \00 is Octal 000.I want to know what meaning the \00 is.
Please refer to the attached trim00.vi.
Solved! Go to Solution.
02-15-2012 11:22 AM
Match Pattern and Match Regular Expression are two different functions. With Match Pattern the string ^[\00]* matches any number of null characters starting at the beginning of the string, while the string [\00]*$ matches any number of null characters starting at the end of the string. Check the help for the Match Pattern function for more info.
Mike...
02-15-2012 11:35 AM
then [\00] maches NULL ? from ASCII, \x00 is NULL, but when I replaced \00 with \x00, the vi not worked well.
02-15-2012 11:45 AM
Any non-numeric character following the back slash is taken literally. This allows you to search for things like the backslash character (by using \\ as a search term - literal character "\").
A slash followed by a number \00 is interpreted as the ASCII representation of that number (in this case NULL).
Using \x00 will look for "x00" (the x is taken as a literal).
I hope this clears up a little confusion.
Rob
02-15-2012 11:54 AM
But I searched <regular expression> entry in the Labview help file, <Special Characters for Match Regular Expression and Search and Replace String> page:
02-15-2012 11:59 AM