Python regular expression question

Gerrit Holl gerrit at
Sun Jun 8 11:46:37 CEST 2003

DJ wrote:
> I cant figure out a re that matches a string in a sentance.
> The string can be anywhere in the sentance
> eg
> "dog"
> I walked my dog today

You don't need re's!

You can simply do:


Or, with Python 2.3, even more simple:

"dog" in line


183. If a man give his daughter by a concubine a dowry, and a husband,
and a deed; if then her father die, she shall receive no portion from the
paternal estate.
        -- 1780 BC, Hammurabi, Code of Law
Asperger Syndroom - een persoonlijke benadering:
Het zijn tijden om je zelf met politiek te bemoeien:

More information about the Python-list mailing list