title: C++ error: no matching function for call to 'regex_match()'
body: <p>I'm struggling with this C++ compiler error to get my regex_match() function to work.  The code:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  #include &lt;regex&gt;
  using namespace std;
  
  struct Person {
      Person(string name, int age)
          : n{name}, a{age}
      {
          regex r("^([!:*&amp;%#@^\\[\\]\"\'])+");             // :*[]"'&amp;^%#@!
          for(char test : n) {
              cout &lt;&lt; "Character: " &lt;&lt; test;
              if(regex_match(test, r)) {
                  cout &lt;&lt; endl &lt;&lt; "Error: wrong character!" &lt;&lt; endl;
              }
          }
      }
      string n;
      int a;
  };
  
  int main() {
      Person Goofy("Goofy",11);
      return 0;
  }
  </code></pre>
  
  <p>I want to check if n contains at least one of the characters I wrote in the regex r().  </p>
  
  <p>Btw, for people learning regex I've found the great website: <a href="https://regex101.com" rel="nofollow noreferrer">https://regex101.com</a>.</p>
  
  <p>Any sugestions?  Thx!!</p>