I am working on a program that reads a stream of binary data from a serial port and needs to parse and format the input.
Data is read in constantly and needs to be displayed as a full string. Each string has a "start code" of 3 bytes and an "end code" of 3 bytes. I need to write a parser that will find the data based on start and end codes - I'm assuming a regex parser is the way to do this.
I've read a bunch of regular expressions over the last day or two but it's just not clicking. Help?
start code: 0x16 < 0x02 (will not be separated by space) end code : 0x03 > 0x17 (will not be separated by space)
can anybody give the regex that will find these values? and is there a way to find them in c# without removing them from the string (i.e. without considering them normal delimiters in, e.g. String.Split())?