On 5/06/2006 10:07 AM, Paul McGuire wrote: > "John Machin" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> Fantastic -- at least for the OP's carefully copied-and-pasted input. >> Meanwhile back in the real world, there might be problems with multiple >> tabs used for 'prettiness' instead of 1 tab, non-integer values, etc etc. >> In that case a loop approach that validated as it went and was able to >> report the position and contents of any invalid input might be better. > > Yeah, for that you'd need more like a real parser... hey, wait a minute! > What about pyparsing?! > > Here's a pyparsing version. The definition of the parsing patterns takes > little more than the re definition does - the bulk of the rest of the code > is parsing/scanning the input and reporting the results. >
[big snip] I didn't see any evidence of error handling in there anywhere. -- http://mail.python.org/mailman/listinfo/python-list