matching and extracting...

Cliff Wells LogiplexSoftware at earthlink.net
Thu Jan 16 16:23:18 EST 2003


On Thu, 2003-01-16 at 04:19, shagshag13 wrote:
> thanks to all !
> 
> that was the stuff that i needed !

Glad to offer real help rather than just stupid comments for once =)

> ("i8" must not be matched to "a8" and yes "i2 is a3" should have been "i2 is
> a2")
> 
> > There are a couple of other potential shortcomings as well, but I
> > decided that this satisfied the OP's exact request.  Handling things
> > outside of that is Left As An Exercise(tm).
> 
> what kind of thing are you thinking about ?
> (But Don't Give Correction(tm) just some guidelines)

Mostly having to do with handling strings that fall outside of the
narrow spec you provided.  As Andrew noted, passing a string such as
"a.1" would be a problem as "." has meaning in the re module.  You
should add some validation code to make sure that anything passed to the
constructor (in the sequence argument) is valid.  However, if you *know*
the strings will always be properly constructed, there shouldn't be a
problem.

Regards,

-- 
Cliff Wells, Software Engineer
Logiplex Corporation (www.logiplex.net)
(503) 978-6726 x308  (800) 735-0555 x308






More information about the Python-list mailing list