Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #30467

Re: write a regex matches 800-555-1212, 555-1212, and also (800) 555-1212.

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 <fgnu32@yahoo.com>
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 <de40c5ae-e51f-4b21-9355-da06a4882c89@googlegroups.com> <5066506D.4020702@tim.thechases.com> <k45kg5$qpo$1@ger.gmane.org> <50665A23.1060300@tim.thechases.com> <CALwzidnA-w_S4EQuS3K46-Te-QBrdz1_yqNqVqchivpmdSB8cg@mail.gmail.com> <50666E1F.2010908@tim.thechases.com>
Date Fri, 28 Sep 2012 21:25:26 -0700 (PDT)
From Fg Nu <fgnu32@yahoo.com>
Subject Re: write a regex matches 800-555-1212, 555-1212, and also (800) 555-1212.
To Tim Chase <python.list@tim.thechases.com>, Ian Kelly <ian.g.kelly@gmail.com>
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 <python-list@python.org>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
Reply-To Fg Nu <fgnu32@yahoo.com>
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1607.1348892859.27098.python-list@python.org> (permalink)
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

Show key headers only | View raw





----- Original Message -----
From: Tim Chase <python.list@tim.thechases.com>
To: Ian Kelly <ian.g.kelly@gmail.com>
Cc: Python <python-list@python.org>
Sent: Saturday, September 29, 2012 9:12 AM
Subject: Re: write a regex matches 800-555-1212, 555-1212, and also (800) 555-1212.

On 09/28/12 22:25, Ian Kelly wrote:
> On Fri, Sep 28, 2012 at 8:17 PM, Tim Chase
>>>> On 09/28/12 19:31, iMath wrote:
>>>>> write a regex matches 800-555-1212, 555-1212, and also (800) 555-1212.
>>
>> r = re.compile(
>>     "800-555-1212|"
>>     "555-1212|"
>>    r"\(800\) 555-1212"
>>     )
> 
> Mine is simpler and faster.
> 
> r = re.compile("")

doh!  «smacks forehead»  Yours is FAR more efficient, and much more
readable than mine.  iMath's teacher will be pleased :-)

-tkc

lulz.

-- 
http://mail.python.org/mailman/listinfo/python-list

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

write a regex matches 800-555-1212, 555-1212, and also (800) 555-1212. iMath <redstone-cold@163.com> - 2012-09-28 17:31 -0700
  Re: write a regex matches 800-555-1212, 555-1212, and also (800) 555-1212. Tim Chase <python.list@tim.thechases.com> - 2012-09-28 20:35 -0500
  Re: write a regex matches 800-555-1212, 555-1212, and also (800) 555-1212. Paul Rubin <no.email@nospam.invalid> - 2012-09-28 18:42 -0700
  Re: write a regex matches 800-555-1212, 555-1212, and also (800) 555-1212. Mark Lawrence <breamoreboy@yahoo.co.uk> - 2012-09-29 02:58 +0100
  Re: write a regex matches 800-555-1212, 555-1212, and also (800) 555-1212. Tim Chase <python.list@tim.thechases.com> - 2012-09-28 21:17 -0500
  Re: write a regex matches 800-555-1212, 555-1212, and also (800) 555-1212. Ian Kelly <ian.g.kelly@gmail.com> - 2012-09-28 21:25 -0600
    Re: write a regex matches 800-555-1212, 555-1212, and also (800) 555-1212. Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-09-29 03:30 +0000
      Re: write a regex matches 800-555-1212, 555-1212, and also (800) 555-1212. Tim Chase <python.list@tim.thechases.com> - 2012-09-28 22:50 -0500
      Re: write a regex matches 800-555-1212, 555-1212, and also (800) 555-1212. Mark Lawrence <breamoreboy@yahoo.co.uk> - 2012-09-29 10:38 +0100
      Re: write a regex matches 800-555-1212, 555-1212, and also (800) 555-1212. Chris Angelico <rosuav@gmail.com> - 2012-09-29 20:05 +1000
      Re: write a regex matches 800-555-1212, 555-1212, and also (800) 555-1212. Mark Lawrence <breamoreboy@yahoo.co.uk> - 2012-09-29 11:50 +0100
      Re: write a regex matches 800-555-1212, 555-1212, and also (800) 555-1212. Ian Kelly <ian.g.kelly@gmail.com> - 2012-09-29 11:04 -0600
      Re: write a regex matches 800-555-1212, 555-1212, and also (800) 555-1212. Chris Angelico <rosuav@gmail.com> - 2012-09-30 09:26 +1000
  Re: write a regex matches 800-555-1212, 555-1212, and also (800) 555-1212. Tim Chase <python.list@tim.thechases.com> - 2012-09-28 22:42 -0500
  Re: write a regex matches 800-555-1212, 555-1212, and also (800) 555-1212. Devin Jeanpierre <jeanpierreda@gmail.com> - 2012-09-29 00:25 -0400
  Re: write a regex matches 800-555-1212, 555-1212, and also (800) 555-1212. Fg Nu <fgnu32@yahoo.com> - 2012-09-28 21:25 -0700

csiph-web