|
Boost : |
From: Preston A. Elder (prez_at_[hidden])
Date: 2005-02-03 02:08:22
On Thu, 03 Feb 2005 14:40:20 +1100, Mathew Robertson wrote:
> I suspect that
> [[:alphanum:]][-[:alphanum:]]*
Uhh, the docs say to use [[:alnum:]], see:
http://www.boost.org/libs/regex/doc/syntax.html (scroll down to 'sets').
> is what is killing you... I'm not even sure what you are trying to match...
The test string was in the application.
What I'm trying to match are words, separated by spaces, where the first
character can be alphanumeric, and any subsequent character can be
alphanumeric or a hyphen.
> BTW: do you need to use capturing (ie parenthesis)? capturing can use
> lots of memory as well...
Obviously, I do if I want to match multiple words, and ensure that the
entire string completely matches the regex (no matter if it matches once
or 100 times).
Trust me, the regex works. I changed my flags to
boost::regex_constants::normal, and it all worked just fine, however it
does not explain why when I was using just the flags
boost::regex_constants::char_classes | boost::regex_constants::intervals,
it refused to match more than two words.
Of course, I could just keep the flags at normal, however I want to be
minimalistic about flags, and as I said, what I had worked, but only for
two words before running out of memory, aparently - which is odd.
-- PreZ :) Founder. The Neuromancy Society (http://www.neuromancy.net)
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk