re. help needed :(

G. Willoughby sab at NOSPAM.freeuk.com
Fri Feb 22 15:03:46 EST 2002


Hi,
    Im trying to replace the single word "lamb" and the word lamb followed
by any punctuation in this string:

x="Mary had a little lamb called lamb, but didn't like the lamb's mood"

i want to replace all of the single words "lamb[punctuation]" but not the
word "lamb's" to achieve this:

x="Mary had a little pig called pig, but didn't like the lamb's mood"

any help with be greatly appreiciated!

ta

G. Willoughby





More information about the Python-list mailing list