pyparsing: parseString confusion

2005-03-11 Thread Peter Fein
ource text (as would be required with parseString)" However: >>> from pyparsing import * >>> alphas 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' >>> word=Word(alphas) >>> word.parseString("foo888") (['foo'], {}) I&#

pyparsing: odd listAllMatches behavior

2005-03-11 Thread Peter Fein
r'], {'OR_word': [('bar', 1)], 'word': [('foo', 0)]}) >>> r.OR_word (['bar'], {}) >>> r.word (['foo'], {}) >>> >>> r=query.parseString('OR bar foo') >>> r (['bar', 'foo'], {'OR_word': [('bar', 0)], 'word': [('foo', 1)]}) >>> r.OR_word 'bar' >>> r.word 'foo' -- Peter Fein [EMAIL PROTECTED] 773-575-0694 Basically, if you're not a utopianist, you're a schmuck. -J. Feldman -- http://mail.python.org/mailman/listinfo/python-list

Re: Pyparsing: Non-greedy matching?

2004-12-30 Thread Peter Fein
r"""/td>""") + SkipTo(">", include=True)) good_ab.setDebug(True) simple=Word(goodchars) complex=Combine(simple | good_ab, adjacent=False, joinString="") data=Combine(OneOrMore(complex), adjacent=False, joinString=" ") ti

Pyparsing: Non-greedy matching?

2004-12-30 Thread Peter Fein
I'm trying to use pyparsing write a screenscraper. I've got some arbitrary HTML text I define as opener & closer. In between is the HTML data I want to extract. However, the data may contain the same characters as used in the closer (but not the exact same text, obviously). I'd like to get the