title: Match zero or more spaces using sscanf
body: <p>Let's have this code</p>
  
  <pre><code>char input[] = "key: value";
  char key[32], value[32];
  sscanf(input, "%31[^:]:%*[ ]%31s", key, value);
  </code></pre>
  
  <p>There can be zero or more spaces after the <code>:</code>, I'd like to store the key ond value into c-string variables. The code above can work with one or more spaces, but tough luck with zero spaces.</p>
  
  <p>Is there a simple way how to parse such strings? No necessarily sscanf, but I'd like to avoid regex.</p>
  
  <p><strong>Edit</strong></p>
  
  <p>I found a <a href="http://www.cplusplus.com/reference/cstdio/scanf/" rel="nofollow">reference</a> supporting the accepted answer (what an useful, but non-intuitive feature):</p>
  
  <blockquote>
    <p>the function will read and ignore any whitespace characters
    encountered before the next non-whitespace character (whitespace
    characters include spaces, newline and tab characters -- see isspace).
    A single <strong>whitespace in the format string validates any quantity of
    whitespace characters</strong> extracted from the stream (<strong>including none</strong>).</p>
  </blockquote>