You can't return a value from out of a constructor. Thats effectively what you're trying to do in main, with the line
Maybe the line you're looking for isCode:result = Regex(to_match, expression);
You can change the compiler to take three arguments, the first a pointer or reference. That would work, I think.Code:Regex r(result, to_match, expression)