?
Solved

Parsing Socket Data STX ETX

Posted on 2009-02-11
1
Medium Priority
?
2,144 Views
Last Modified: 2012-05-06
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
0
Comment
Question by:codejunky
1 Comment
 

Accepted Solution

by:
codejunky earned 0 total points
ID: 23616539
the answere to the questions is to use a ungreedy instead of greedy expression you do this with the "?"

\x02(.*?)\x03
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
High user turnover can cause old/redundant user data to consume valuable space. UserResourceCleanup was developed to address this by automatically deleting user folders when the user account is deleted.
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question