title: What is the purpose of using the [^ notation in scanf?
body: <p>I have run into some code and was wondering what the original developer was up to. Below is a simplified program using this pattern:</p>
  
  <pre><code>      #include &lt;stdio.h&gt;
  
        int main()  {     
  
        char title[80] = "mytitle";      
        char title2[80] = "mayataiatale";      
        char mystring[80]; 
  
        /* hugh ? */
        sscanf(title,"%[^a]",mystring);
        printf("%s\n",mystring); /* Output is "mytitle" */
  
  
        /* hugh ? */
        sscanf(title2,"%[^a]",mystring); /* Output is "m" */
        printf("%s\n",mystring);
  
  
        return 0;  
    }
  </code></pre>
  
  <p>The <a href="https://linux.die.net/man/3/scanf" rel="noreferrer">man page for scanf</a> has relevant information, but I'm having trouble reading it. What is the purpose of using this sort of notation? What is it trying to accomplish?</p>