On Fri, Sep 28, 2012 at 8:17 PM, Tim Chase <python.l...@tim.thechases.com> wrote: > On 09/28/12 20:58, Mark Lawrence wrote: >> On 29/09/2012 02:35, Tim Chase wrote: >>> On 09/28/12 19:31, iMath wrote: >>>> write a regex matches 800-555-1212, 555-1212, and also (800) 555-1212. >>> >>> Okay, that was pretty easy. Thanks for the challenge :-) >> >> What's the run time speed like? > > O(1) > > r = re.compile( > "800-555-1212|" > "555-1212|" > r"\(800\) 555-1212" > )
Mine is simpler and faster. r = re.compile("") -- http://mail.python.org/mailman/listinfo/python-list