title: How to use pyparsing LineStart?
body: <p>I'm trying to use pyparsing to parse key:value pairs from the comments in a document.  A key starts at the beginning of a line, and a value follows.  Values may be continued on multiple lines that begin with whitespace.</p>
  
  <pre><code>import pyparsing as pp
  
  instring = """
  -- This is (a) #%^&amp; comment
  
  /*
  name1: val
  name2: val2 with $*&amp;#@) junk
  name3: val3: with @)(*% multi-
         line: content
  */
  """
  
  comment1 = pp.Literal("--") + pp.originalTextFor(pp.SkipTo(pp.LineEnd())).setDebug()
  identifier = pp.Word(pp.alphanums + "_").setDebug()
  meta1 = pp.LineStart() + identifier + pp.Literal(":") + pp.SkipTo(pp.LineEnd())
  meta2 = pp.LineStart() + pp.White() + pp.SkipTo(pp.LineEnd())
  metaval = meta1 + pp.ZeroOrMore(meta2)
  metalist = pp.ZeroOrMore(comment1) + pp.Literal("/*") + pp.OneOrMore(metaval) + pp.Literal("*/")
  
  if __name__ == "__main__":
      p = metalist.parseString(instring)
      print(p)
  </code></pre>
  
  <p>Fails with:</p>
  
  <pre><code>Matched {Empty SkipTo:(LineEnd) Empty} -&gt; ['This is (a) #%^&amp; comment']
  
  File "C:\Users\user\py3\lib\site-packages\pyparsing.py", line 2305, in parseImpl
  raise ParseException(instring, loc, self.errmsg, self)
  pyparsing.ParseException: Expected start of line (at char 32), (line:4, col:1)
  </code></pre>
  
  <p>The answer to <a href="https://stackoverflow.com/questions/26600333/pyparsing-whitespace-match-issues">pyparsing whitespace match issues</a> says</p>
  
  <pre><code>LineStart has always been difficult to work with, but ...
  </code></pre>
  
  <p>If the parser is at line 4 column 1 (the first key:value pair), then why is it not finding a start of line?   What is the correct pyparsing syntax to recognize lines beginning with no whitespace and lines beginning with whitespace?</p>