View Single Post
Old 04-19-2011, 01:17 PM   #8
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,734
Karma: 6690881
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
If you are replacing all occurrences of commas with backslashes, then you should use str.replace instead of re.sub. Replace will be much faster.

I am also wondering about the choice of backslash. My concern is that it could be misinterpreted as an escape in some situations. In particular, backslashes could easily get stripped or misinterpreted in search expressions.
chaley is offline   Reply With Quote