title: How to find substring between quotation marks in C
body: <p>If I have a string such as the string that is the command</p>
  
  <blockquote>
    <p>echo 'foobar'|cat</p>
  </blockquote>
  
  <p>Is there a good way for me to get the text between the quotation marks ("foobar")? I read that it was possible to use <code>scanf</code> to do it in a file, is it also possible in-memory? </p>
  
  <p>My attempt:</p>
  
  <pre><code>  char * concat2 = concat(cmd, token);
    printf("concat:%s\n", concat2);
    int res = scanf(in, " '%[^']'", concat2);
    printf("result:%s\n", in);
  </code></pre>