Hi!
Weird, but looks more like a VC bug than a regex one - after all the *only* difference between the two examples is whether the string passed to regex_format is a variable or a temporary, so unless I'm missing something it's got to be a compiler problem?
Well, I don't think, it's a compiler problem.
stringbuf::str() retuns a temporary string. This is passed on to
regex_match().
The real problem is, the data in matchInfo is not stored as a copy of the
processed string, but as a reference to its characters.
So, when the temoprary string is being destroyed, the result in matchInfo is
also lost.
Even the following short code failes, using a temporary string as argument
for regex_match():
#include <string>
#include <iostream>
using namespace std;
#include