Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

commaSeparatedList Not Working Accross Newline

Jim P
2014-03-14
2014-03-14
  • Jim P
    Jim P
    2014-03-14

    commaSeparatedList will not work across newlines:

    from pyparsing import *
    greet = commaSeparatedList
    hello = "Hello, World!\nyes,me\nwhat,yes"
    result = greet.parseString( hello )
    print result

    ['Hello', 'World!']

    If I wrap commaSeparatedList in OneOrMore it enters an infinite loop and I am not sure why. I would like to avoid going line by line and using commaSeparatedList.

    Thanks