filtering out "bad" regular expressions from user input
Aahz Maruch
aahz at panix.com
Fri Sep 29 14:49:45 EDT 2000
In article <mailman.970252786.23630.python-list at python.org>,
Skip Montanaro <skip at mojam.com> wrote:
>
>As usual, I specified the problem incompletely. The problem isn't so much
>regular expressions that perform poorly when matched against particular
>strings. It is that some very simple regular expressions (like ".*") can
>match all (or almost all) records in a database of 20,000 or so rows.
>Marshalling and returning that amount of information from MySQL to my
>front-end code takes a substantial amount of time, as you might imagine.
I'd suggest using a cursor (or perhaps MySQL supports TOP or the
equivalent) and just returning a subset. You'd probably want to present
a comment such as "Returning top 1000 rows of 23000 records that match
your query".
--
--- Aahz (Copyright 2000 by aahz at pobox.com)
Androgynous poly kinky vanilla queer het <*> http://www.rahul.net/aahz/
Hugs and backrubs -- I break Rule 6
Shadows 2000: when you're tired of "Cthulhu for President" --Aahz
More information about the Python-list
mailing list