title: using regex matching in c++ to determine if binary
body: <p>I am trying to use regex in c++ to determine if a string only contains binary (1/0). I did this in java using .matches("[01]+") quite simply. However now when I'm trying to convert to c++ I'm having issues</p>
  
  <p>I'm using Visual studio 2010 and get this error</p>
  
  <p>Error: no instance of overloaded function "regex_match" matches the argument list</p>
  
  <p>Here is my code</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  #include &lt;regex&gt;
  using namespace std;
  
  // ...
  
  string bFU;
  do
  {
      cout &lt;&lt; "\nEnter a binary value containing up to 16 digits: ";
      getline (cin, bFU);
      if (!regex_match(bFU, "[01]+") || bFU.length()&gt;16)
      {
          cout &lt;&lt; "\nError: Invalid binary value.\nTry again.\n"
                  "Press Enter to continue ... ";
          bFU = "a";
          cin.ignore(80, '\n');
      }
  } while (!regex_match(bFU, "[01]+"));
  </code></pre>
  
  <p>In visual studio I get that error when I mouse over the regex_match which is red underlined</p>
  
  <p>Thanks for the help, I've been googling and sorting through dozens of websites and it just is making the problem even more fuzzy</p>