Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.011 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; '(at': 0.04; 'expressions': 0.07; 'string': 0.09; 'python': 0.11; 'from:addr:pobox.com': 0.16; 'from:addr:skip': 0.16; ':-)': 0.16; 'sender:addr:gmail.com': 0.17; 'shell': 0.22; 'skip': 0.24; 'least': 0.26; 'header:In- Reply-To:1': 0.27; 'fastest': 0.30; 'message-id:@mail.gmail.com': 0.30; 'perl': 0.31; 'regular': 0.32; 'knows': 0.35; 'received:google.com': 0.35; 'method': 0.36; 'should': 0.36; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'everybody': 0.60; 'subject:skip:S 10': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=aRc5rG5iEYcD2XsZTkMy4MaMLVaLQSBB19luDwzyj9w=; b=fiFyZnM/juRpO+rs/vjpbXQkfkXvuyIf/Jjl8EGTn/71ef79+Nk67yZh+UfJ7wdvIi SRxyIuRM5Z0VM+4erk8FWyxWNh5PcHtcdl7xrKC3dc78x8KPOy0xoiXm3D5gyINjWjRt TFfWBA2+9caUhya0uEgw0jtIq/21SfUa/tyUoyh2JiDQ4tv9YrzHaFlLiS7J03AknFrl e8UhRjPXluRByxaEtUe5Tp9bDVabON02TNPu8+53ULOvCAEc3Klq4ZVBlZBCn4qGzyst LNGpZqpVYW0kIr2VhOnWKMMh5N3AaJdIcm9v6W7V9FW5V7+8eZpQkljLVdFOF061hro2 5Duw== MIME-Version: 1.0 X-Received: by 10.42.101.80 with SMTP id d16mr12028756ico.93.1374257315477; Fri, 19 Jul 2013 11:08:35 -0700 (PDT) Sender: skip.montanaro@gmail.com In-Reply-To: References: <51e967bb$0$29971$c3e8da3$5496439d@news.astraweb.com> Date: Fri, 19 Jul 2013 13:08:35 -0500 X-Google-Sender-Auth: tFocRKA33a6ExrbWm5AZfTdv_u8 Subject: Re: Find and Replace Simplification From: Skip Montanaro To: Python Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 7 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1374257324 news.xs4all.nl 15905 [2001:888:2000:d::a6]:57475 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:50919 Serhiy> The string replace() method is fastest (at least in Python 3.3+). See Serhiy> implementation of html.escape() etc. I trust everybody knows by now that when you want to use regular expressions you should shell out to Perl for the best performance. :-) Skip