I was playing around with Boost::regex and this is the first time I'm working with regex as well as Boost, so forgive me if the question is really stupid.
I am getting a NO_MATCH with the following values:
actual_name = "q\[0\]123"
user_name = "q[0]123"
P.S. In the debugger, when I printed actual_name
it showed - q\\[0\\]123
. But, when I did actual_name.size(), it came out to be 9.
Here is my code:
boost::regex regexpr( actual_name );
boost::match_results<pstring::const_iterator> what;
boost::regex_match(user_name, what, regexpr);
if(what[0].matched)
{
// Match found
}
else
{
// NO_match found
}
I tried the same combination of regular_expression = "q\[0\]123"
and test-string = "q[0]123"
on Rubular.com and it returns a Complete_Match there.
What am I missing?