Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #30467
| References | (1 earlier) <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 | 2012-09-28 21:25 -0700 |
| From | Fg Nu <fgnu32@yahoo.com> |
| Subject | Re: write a regex matches 800-555-1212, 555-1212, and also (800) 555-1212. |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.1607.1348892859.27098.python-list@python.org> (permalink) |
----- 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 | Next — Previous in thread | Find similar | Unroll 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