Path: csiph.com!usenet.pasdenom.info!news.albasani.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.030 X-Spam-Evidence: '*H*': 0.94; '*S*': 0.00; 'matches': 0.07; 'python': 0.09; 'sep': 0.09; 'to:addr:python.list': 0.09; 'to:addr:tim.thechases.com': 0.09; 'to:name:tim chase': 0.09; 'cc:addr:python-list': 0.10; ':-)': 0.13; '-tkc': 0.16; 'readable': 0.16; 'wrote:': 0.17; 'tim': 0.18; 'subject:) ': 0.20; 'simpler': 0.22; 'cc:2**0': 0.23; 'to:2**1': 0.23; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; '>>>>': 0.29; 'chase': 0.29; 'url:mailman': 0.29; 'fri,': 0.30; 'url:python': 0.32; '-----': 0.32; 'skip:8 10': 0.32; 'url:listinfo': 0.32; 'reply-to:addr:yahoo.com': 0.34; 'mine': 0.35; 'pm,': 0.35; 'subject:': 0.36; 'url:org': 0.36; 'subject: (': 0.36; 'sent:': 0.37; 'far': 0.37; 'subject:: ': 0.38; 'from:': 0.38; 'skip:" 10': 0.40; 'subject:-': 0.40; 'url:mail': 0.40; 'subject:, ': 0.61; 'more': 0.63; 'pleased': 0.66; 'header:Reply- To:1': 0.68; 'received:122': 0.70; 'received:122.161': 0.84; 'subject:write': 0.84; 'yours': 0.88; 'faster.': 0.91; 'received:98.138.226': 0.91 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 407948.21079.bm@omp1026.mail.ne1.yahoo.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1348892726; bh=gZU7KhkL9I68eC3Jl8ASgLTAIDvCY47EUuE+1aoVGLE=; h=X-YMail-OSG:Received:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=ByFn84oKwZWhRz/9FqZt6MP/q0JkuvmU7kzjuj4J6QDRg+7/W33eRjR1QwHnUG6+ohJd58TPL+ahPbHq8pAohYc7RlMi8QKA+DMnj6fjgIXl9WvFqBcFpiJBcu17F5wmVE1Si5Vh5eEozPViyu1uA4S3fSR98lqNnHMNUvXgDYs= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=GtD1kpuLnHx5mtIP0203BKrD1ObI6lJMls6Y6QAq/AEvks/tGhACjcBwCpMV9UDe+x9IgVLpRajH4hVXoWrj3k4zbTvkmAd9L5bEoWxwQSxgwroAtMQvKUo0R3Zxs33osMsJ6ftpGVlHLiIdcnIj7oa0r7E3iyEkYXiZLfvNRVk=; X-YMail-OSG: lItsBf4VM1mUFw7p7WNyO0gzdGH.gpYtThHJ2TX2WdhfVHz CIz6yXbg1Ce4eB1BZZij6T9tmj7BfAdrGaB5V4lh5t7L3HK1LeXAGHrbr6U9 6M1BLdDLFM9VXwck3kX.yN1xZ4ey0LXZN9B3bSFcbn.s8Fy9OcYbjLk5Aw5m .DXGXvz_KfToMp9B66eWgxH0M_nC1Umlxl80BZosWLK3RHjyffaaoDfRs82v GZETFg34Yj6v4W9mQUHct.YRvH_mA2ZcNHN2RUvQ1_02HNBPj11vHHmEHhky mwvZkopwf..vMu4TYjq5n9qMYyQBQnowoWqVS8ZkhYAwctthyv.E253ebn6D vMuqJXxAkkj2tC8CotzdJ3TpNtXq0VxW_GzdJaNfIHjDOC.KuasQ03mdlrU7 golveKzGAARN_RW3UvQWgaZdr.wJRbvY3mC0gAEmOhOp.4ga7tnLt7yyizwi bWLl1gw-- X-Mailer: YahooMailWebService/0.8.121.434 References: <5066506D.4020702@tim.thechases.com> <50665A23.1060300@tim.thechases.com> <50666E1F.2010908@tim.thechases.com> Date: Fri, 28 Sep 2012 21:25:26 -0700 (PDT) From: Fg Nu Subject: Re: write a regex matches 800-555-1212, 555-1212, and also (800) 555-1212. To: Tim Chase , Ian Kelly In-Reply-To: <50666E1F.2010908@tim.thechases.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Python X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Fg Nu 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: 13 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1348892859 news.xs4all.nl 6891 [2001:888:2000:d::a6]:38808 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:30467 =0A=0A=0A=0A----- Original Message -----=0AFrom: Tim Chase =0ATo: Ian Kelly =0ACc: Python =0ASent: Saturday, September 29, 2012 9:12 AM=0ASubject: = Re: write a regex matches 800-555-1212, 555-1212, and also (800) 555-1212.= =0A=0AOn 09/28/12 22:25, Ian Kelly wrote:=0A> On Fri, Sep 28, 2012 at 8:17 = PM, Tim Chase=0A>>>> On 09/28/12 19:31, iMath wrote:=0A>>>>> write a regex = matches 800-555-1212, 555-1212, and also (800) 555-1212.=0A>>=0A>> r =3D re= .compile(=0A>>=A0 =A0 "800-555-1212|"=0A>>=A0 =A0 "555-1212|"=0A>>=A0 =A0= r"\(800\) 555-1212"=0A>>=A0 =A0 )=0A> =0A> Mine is simpler and faster.=0A= > =0A> r =3D re.compile("")=0A=0Adoh!=A0 =ABsmacks forehead=BB=A0 Yours is = FAR more efficient, and much more=0Areadable than mine.=A0 iMath's teacher = will be pleased :-)=0A=0A-tkc=0A=0Alulz.=0A=0A-- =0Ahttp://mail.python.org/= mailman/listinfo/python-list=0A