I'm trying to determine whether or not a string contains a number. This doesn't seem to be working.
static const regex re("([0-9]+)");
cout << regex_match("L5开发者_开发问答", re);
prints
0
Thanks!!
From the boost docs on regex_match:
Note that the result is true only if the expression matches the whole of the input sequence. If you want to search for an expression somewhere within the sequence then use regex_search.
精彩评论