Hey folks, I'm trying to figure out how to do something, and it feels like it should be possible, but I can't figure out how. What I want is to define four expressions, like so:
(\sNorth\s|\sN\s)(\sSouth\s|\sS\s)(\sEast\s|\sE\s)(\sWest\s|\sW\s) And then run a replace such that the groups are replaced, in order, with "N ", "S ", "E ", or "W " (capital letters, no spaces before). It's easy enough to use re.sub to replace ONE of those, and I could just do that four times, but is there a way to do all at once? It looks from some things I've seen like it should be, but I can't figure out how. Thanks, Andy McKenzie
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor