Path: csiph.com!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail From: Joel Goldstick Newsgroups: comp.lang.python Subject: Re: Regular expressions Date: Tue, 3 Nov 2015 10:34:12 -0500 Lines: 37 Message-ID: References: <662g3blobme52hfoududj27err185v2npm@4ax.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de Jg/gqqBShd21HlIDgYqDNQWrdO6Q2VpZClZCpkiYHH/A== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.015 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'else:': 0.03; 'cc:addr :python-list': 0.09; 'python': 0.10; '10:17': 0.16; '>on': 0.16; 'received:209.85.213.176': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'subject:Regular': 0.16; 'subject:expressions': 0.16; 'wrote:': 0.16; '>': 0.18; '2015': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'trying': 0.22; 'tim': 0.24; 'header:In-Reply-To:1': 0.24; 'mon,': 0.24; 'message- id:@mail.gmail.com': 0.27; 'regular': 0.29; 'chase': 0.29; 'url:mailman': 0.30; 'url:python': 0.33; 'url:listinfo': 0.34; 'received:google.com': 0.35; 'nov': 0.35; 'but': 0.36; 'url:org': 0.36; 'received:209.85': 0.36; 'heard': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'thanks': 0.37; 'received:209.85.213': 0.37; 'thought': 0.37; 'wanted': 0.37; 'doing': 0.38; 'received:209': 0.38; 'end': 0.39; 'url:mail': 0.40; 'your': 0.60; 'asterisk': 0.84; 'seymore4head': 0.84; 'to:none': 0.91; 'joel': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=T0SCJ0jwBNkdnecatq6i+dAYIjV0L3tb+NOehkFrp/4=; b=omAIP08AbHlrPDsJdOBN7F8epWA5tNdLPK41beToxzPdZIi+vS7VfcaoRE3weU+IuW S47s7LZ6gnEaMXcjGkn77PqmSShUVDEjJMbvJRlf1X7hdbzAqTacMYVhz5aWanXTWfMX 8cZ+LXBKGsfUaplPhQEP0RRRO9l1NuoV+JVH7itoCJRbe5Vm0FKeqwAZzm1817Sl7e2W MR+SEWOyF8Vp/BkF/Kn98bNBc1aEwlZsiOpqRqT9VrCT34Sp0MEWNh57ancGEBUObPoj 0EXWnhB4a/lti7tAGeic1LHX61CLl7IKYXzj3yLINStJLrpL/irt7hipj1nVVqvMdqyC 0vCw== X-Received: by 10.50.117.102 with SMTP id kd6mr15928047igb.41.1446564852743; Tue, 03 Nov 2015 07:34:12 -0800 (PST) In-Reply-To: X-Content-Filtered-By: Mailman/MimeDel 2.1.20+ 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:98164 On Mon, Nov 2, 2015 at 10:17 PM, Seymore4Head wrote: > On Mon, 2 Nov 2015 20:42:37 -0600, Tim Chase > wrote: > > >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 > > > > > Because that is the part of Python I am trying to learn at the moment. > Are we to infer that you were aware of doing the if line[-1] == '*': ... , but just wanted to learn how to do the same thing with regex? Or that you heard about regexes and thought that would be the way to solve your puzzle? > Thanks > -- > https://mail.python.org/mailman/listinfo/python-list > -- Joel Goldstick http://joelgoldstick.com/stats/birthdays