0

Hi, I'm trying to fork out number from this expression. Obviously without any luck. I wonder if anyone could help and suggest good book about regex.

boost::regex reg("[[:blank:]]*move[[:blank:]]*\\d{1,3}[[:blank:]]*, boost::regbase::icase);

Thank you

1
Contributor
1
Reply
2
Views
7 Years
Discussion Span
Last Post by atch
0
boost::regex reg("[[:blank:]]*move[[:blank:]]*\\d{1,3}[[:blank:]]*, boost::regbase::icase);

Thank you

Ok I've figured it out. If I use parenthesis around subexpressions which I want to catch (move) and (\\d{1,3}), then by adding:

boost::match_results<std::string::const_iterator> m_r;

and finally:

(boost::regex_match("some_string", m_r, reg)

then I have :

cerr << "m_r[0]" << m_r[0] << endl;
cerr << "m_r[1]" << m_r[1] << endl;

I mark this as a resolved thread.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.