trying to match a string
oj
ojeeves at gmail.com
Mon Jul 21 07:08:05 EDT 2008
On Jul 21, 11:04 am, Fredrik Lundh <fred... at pythonware.com> wrote:
> The drawback is that it's a lot easier to mess up the edge cases if you
> do that (as this thread has shown). The small speedup you get in
> typical cases is quickly offset by extra debugging/testing time (or, for
> that matter, arguing with c.l.py:ers over more or less contrived ways to
> interpret the original post).
I disagree, from this thread, most of the erroneous solutions have
been attempts to match the entire string.
> Guess it's up to personal preferences for how to best help others.
> Unless the OP explicitly asks for something else, I prefer to use simple
> and straight-forward solutions with reasonable execution behaviour over
> clever tricks or odd-ball solutions; it's not a JAPH contest, after all.
[^LRM] *is* a simple and straight-forward regex - it isn't attempting
to do any clever tricks or anything odd-ball.
That said, I still think the sets solution is more elegant then the
regex solutions.
More information about the Python-list
mailing list