#include <iostream>
#include <string>
#include <regex>
using namespace std;
void Test(const char* str, const char* regExpression)
{
    regex rx(regExpression);
    bool match = regex_match(str, rx);
    bool search = regex_search(str, rx);
    cout << "String: " << str << "  expression: " << regExpression <<
        "   match: " << (match ? "yes" : "no ") <<
        "   search: " << (search ? "yes" : "no ")  << endl;
}
int main()
{
    Test("a", "a");
    Test("a", "abc");
    return 0;
}
Results in g++:
String: a  expression: a   match: yes   search: no 
String: a  expression: abc   match: no    search: no 
Results in VS2012:
String: a  expression: a   match: yes   search: yes
String: a  expression: abc   match: no    search: no
What is correct result?. Also, what is the difference between regex_match and regex_search?