Re: [Pyparsing] whitespace related question
Brought to you by:
ptmcg
From: stefaan.himpe <ste...@gm...> - 2008-06-24 21:19:31
|
Hello, and I have one follow-up question, The solution I had was able to parse tables with empty cells, but after incorporating your suggestions this no longer works. At first I expected it would be trivial to extend the parser to handle empty cells, but so far I haven't managed to get something working :( I have tried to extend the list_of_cols definition in many ways and I have tried to replace + with ^ in some places... I am still missing some fundamental insights in how pyparsing works to unravel this little mystery. I'd be really grateful for some input. Best regards, Stefaan. to given an idea of some of many attempts (replace list_of_cols in the earlier posted code) list_of_cols = p.delimitedList(p.Word(" \t") | p.Regex(r"[^#\n\r]+"), "#") or list_of_cols = p.delimitedList(p.Regex(r"[^#\n\r]*"), "#") |