Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!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.010 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'subject:Python': 0.06; 'subject:module': 0.09; 'subject:using': 0.09; 'cc:addr:python- list': 0.11; 'missed': 0.12; '-tkc': 0.16; 'from:addr:python.list': 0.16; 'from:addr:tim.thechases.com': 0.16; 'from:name:tim chase': 0.16; 'received:10.21': 0.16; 'thread,': 0.16; 'wrote:': 0.18; 'seems': 0.21; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'fast.': 0.31; 'this.': 0.32; 'could': 0.34; 'test': 0.35; 'charset:us-ascii': 0.36; 'received:10': 0.37; 'explain': 0.39; 'dave': 0.60; 'subject: ': 0.61; 'name:': 0.61; 'subject:Search': 0.84; 'angel': 0.91 X-Sender-Id: wwwh|x-authuser|tim@thechases.com X-Sender-Id: wwwh|x-authuser|tim@thechases.com X-MC-Relay: Neutral X-MailChannels-SenderId: wwwh|x-authuser|tim@thechases.com X-MailChannels-Auth-Id: wwwh X-MC-Loop-Signature: 1427333272622:1173691355 X-MC-Ingress-Time: 1427333272622 Date: Wed, 25 Mar 2015 20:29:06 -0500 From: Tim Chase To: Dave Angel Cc: python-list@python.org Subject: Re: Basic Python V3 Search Tool using RE module In-Reply-To: <55135EE3.3080809@davea.name> References: <55135EE3.3080809@davea.name> X-Mailer: Claws Mail 3.8.1 (GTK+ 2.24.10; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-AuthUser: tim@thechases.com X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.19 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: 15 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1427345768 news.xs4all.nl 2840 [2001:888:2000:d::a6]:54255 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:88024 On 2015-03-25 21:20, Dave Angel wrote: >> pattern="DECRYPT_I" >> regexp=re.compile(pattern) > > That could explain why it's so fast. While I might have missed it in the thread, it also seems that regexpen are overkill for this. Why not just test for if pattern in name: ... -tkc