On Mon, Apr 21, 2008 at 10:31 AM, reuben12 <[EMAIL PROTECTED]> wrote:

>  I'm thinking this is a common enough problem and must have been
>  already more efficiently solved(than i can ever write)
>
>  Is there anything in standard library that i can use?

Here are some examples of string tokenizing with C++ using standard C++ classes:

http://www.cprogramming.com/faq/cgi-bin/smartfaq.cgi?answer=1057105750&id=1044780608

>  I have not used regex before but think it will only provide me the
>  pattern matching and not expand the ranges.

Personally, I would use regular expressions. The Perl Compatible
Regular Expression library is quite excellent:

http://www.pcre.org/

And you can use it for all kinds of pattern matching, splitting up
strings, etc, just like in Perl. You will still need to expand the
ranges in your code logic regardless of how you parse the text.

-- Brett
------------------------------------------------------------
"In the rhythm of music a secret is hidden;
 If I were to divulge it, it would overturn the world."
 -- Jelaleddin Rumi

Reply via email to