I would like to pass the variable from a function to the main scope which I'm calling, I'm trying to do like I use to do in C but it returns nothing.

I want to be able to output and deal with it after the return of the function

```
#include "StdAfx.h"
#include <regex>
#include <iostream>
#include <string>
#include <conio.h>
using namespace std;

std::tr1::match_results<std::string::const_iterator> match(std::string& regex, const std::string& ip,std::tr1::match_results<std::string::const_iterator> res)
{
   const std::tr1::regex pattern(regex.c_str());
   bool valid = std::tr1::regex_match(ip, res, pattern);
   std::cout << ip << " \t: " << (valid ? "valid" : "invalid") << std::endl;
   cout << "FIRST RES FOUND: " << res[1] << endl;  
   return res;
}

int main()
{

   string regex = "(\\d{1,3}):(\\d{1,3}):(\\d{1,3}):(\\d{1,3})";
   string ip = "49:22:33:444";
   std::tr1::match_results<std::string::const_iterator> res;
   match(regex,ip.c_str(), res);

   cout << "Result >" << res[1] << "< " << endl;

   _getch(); return 0;
}

```

When I compile and run, The output is: "FIRST RES FOUND: 49
Result ><"

It's probably a really simple solution but what do I have to do to set it for my main can read it correctly as in: "Result >49<"

Thanks in advance. :)