Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #38356 > unrolled thread

Re: Curious to see alternate approach on a search/replace via regex

Started bySerhiy Storchaka <storchaka@gmail.com>
First post2013-02-07 18:56 +0200
Last post2013-02-07 18:56 +0200
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Curious to see alternate approach on a search/replace via regex Serhiy Storchaka <storchaka@gmail.com> - 2013-02-07 18:56 +0200

#38356 — Re: Curious to see alternate approach on a search/replace via regex

FromSerhiy Storchaka <storchaka@gmail.com>
Date2013-02-07 18:56 +0200
SubjectRe: Curious to see alternate approach on a search/replace via regex
Message-ID<mailman.1453.1360256193.2939.python-list@python.org>
On 07.02.13 11:49, Peter Otten wrote:
> ILLEGAL = "-:./?&="
> try:
>      TRANS = string.maketrans(ILLEGAL, "_" * len(ILLEGAL))
> except AttributeError:
>      # python 3
>      TRANS = dict.fromkeys(map(ord, ILLEGAL), "_")

str.maketrans()

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web