Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Tim Chase Newsgroups: comp.lang.python Subject: Re: Regular expressions Date: Mon, 2 Nov 2015 20:42:37 -0600 Lines: 15 Message-ID: References: <662g3blobme52hfoududj27err185v2npm@4ax.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de cz1AHDscwv9srSFVEUrrEg+5R3NgVb/QzeCn9xvVL/EA== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'else:': 0.03; 'cc:addr :python-list': 0.09; '-tkc': 0.16; 'from:addr:python.list': 0.16; 'from:addr:tim.thechases.com': 0.16; 'from:name:tim chase': 0.16; 'received:10.122': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'subject:Regular': 0.16; 'subject:expressions': 0.16; 'wrote:': 0.16; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'cc:no real name:2**0': 0.22; 'header:In-Reply-To:1': 0.24; 'regular': 0.29; 'subject:: ': 0.37; 'received:10': 0.37; 'charset :us-ascii': 0.37; 'end': 0.39; 'why': 0.39; 'received:50': 0.66; 'asterisk': 0.84; 'seymore4head': 0.84 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: 1446518637676:1918710613 X-MC-Ingress-Time: 1446518637676 In-Reply-To: <662g3blobme52hfoududj27err185v2npm@4ax.com> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.25; x86_64-pc-linux-gnu) X-AuthUser: tim@thechases.com X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:98123 On 2015-11-02 20:09, Seymore4Head wrote: > How do I make a regular expression that returns true if the end of > the line is an asterisk Why use a regular expression? if line[-1] == '*': yep(line) else: nope(line) -tkc