pyparsing: parseString confusion

P

Peter Fein

My understanding of parseString seems flawed: I thought the grammar must
match the string in its entirety, based on the following from the howto:

"scanString allows you to scan through the input source string for
random matches, instead of exhaustively defining the grammar for the
entire source text (as would be required with parseString)"

However:(['foo'], {})

I'd expect this to raise an exception. What am I missing here?
 
I

infidel

I've notice the same thing. It seems that it will return as much as it
can that matches the grammar and just stop when it encounters something
it doesn't recognize.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,222
Messages
2,571,140
Members
47,755
Latest member
Grazynkaa

Latest Threads

Top