Parsing Socket Data STX ETX

what is the best way to parse inforamtion coming in through a socket. The data looks like this
<STX>
some data
<ETX>
1byte(checksum)
<STX>
some data
<ETX>
1byte(checksum)

I was thinking of using a regular expression, but the expression \x02(.*)\x03 could give me 1 match instead of breaking them into 2 matches when using the example above. Does anyone know how the proper regular expression would be written?

Thanks in advance
codejunkyAsked:
Who is Participating?
 
codejunkyConnect With a Mentor Author Commented:
the answere to the questions is to use a ungreedy instead of greedy expression you do this with the "?"

\x02(.*?)\x03
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.