idiom for RE matching
bignose+hates-spam at benfinney.id.au
Thu Jul 26 04:53:36 CEST 2007
Gordon Airporte <JHoover at fbi.gov> writes:
> The actual code uses the proper 'if foo in line or if bar in line:'
>>> line = "spam eggs ham"
>>> foo = "spam"
>>> bar = "sausage"
>>> if foo in line or if bar in line:
File "<stdin>", line 1
if foo in line or if bar in line:
SyntaxError: invalid syntax
Not that I want to pick on you; I just don't want something wrong
labelled as "proper" to go unchallenged in the archives :-)
\ "Never do anything against conscience even if the state demands |
`\ it." -- Albert Einstein |
More information about the Python-list