alternating string replace

Steven D'Aprano steve at REMOVE-THIS-cybersource.com.au
Sat Jan 12 03:42:00 CET 2008


On Fri, 11 Jan 2008 14:55:18 -0600, Reedick, Andrew wrote:

> For those of us who still think in Perl, here's an easy to read 
...
> s = re.sub(r'_(.*?(_|$))', r':\1', s)

"Easy to read"? Oh that's priceless. Andrew, you should consider writing 
comedy professionally!



-- 
Steven



More information about the Python-list mailing list