Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!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.021 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'python': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'sep': 0.09; 'devs': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'wrote:': 0.17; 'memory': 0.18; 'simpler': 0.22; 'header:In-Reply-To:1': 0.25; 'header:User- Agent:1': 0.26; "doesn't": 0.28; 'header:X-Complaints-To:1': 0.28; "d'aprano": 0.29; 'steven': 0.29; 'fri,': 0.30; 'from:addr:yahoo.co.uk': 0.32; 'surely': 0.33; 'to:addr:python- list': 0.33; 'mine': 0.35; 'received:org': 0.36; 'subject: (': 0.36; 'subject:: ': 0.38; 'mark': 0.38; 'performance': 0.39; 'to:addr:python.org': 0.39; 'subject:-': 0.40; 'header:Received:5': 0.40; 'skip:u 10': 0.60; 'subject:, ': 0.61; 'back': 0.62; 'us,': 0.74; 'subject:write': 0.84; 'faster.': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Mark Lawrence Subject: Re: write a regex matches 800-555-1212, 555-1212, and also (800) 555-1212. Date: Sat, 29 Sep 2012 10:38:17 +0100 References: <5066506D.4020702@tim.thechases.com> <50665A23.1060300@tim.thechases.com> <50666b49$0$29981$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: host-92-24-209-106.ppp.as43234.net User-Agent: Mozilla/5.0 (Windows NT 6.0; rv:15.0) Gecko/20120907 Thunderbird/15.0.1 In-Reply-To: <50666b49$0$29981$c3e8da3$5496439d@news.astraweb.com> X-Antivirus: avast! (VPS 120928-1, 28/09/2012), Outbound message X-Antivirus-Status: Clean 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: 25 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1348911398 news.xs4all.nl 6862 [2001:888:2000:d::a6]:45697 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:30472 On 29/09/2012 04:30, Steven D'Aprano wrote: > On Fri, 28 Sep 2012 21:25:35 -0600, Ian Kelly wrote: > >> Mine is simpler and faster. >> >> r = re.compile("") > > The OP doesn't say that you have to compile it, so just: > > '' > > wins. > > > My understanding is that Python 3.3 has regressed the performance of ''. Surely the Python devs can speed the performance back up and, just for us, use less memory at the same time? -- Cheers. Mark Lawrence.