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

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks