Re: Detecting potential regular expression matches?
- From: "Michael A. Cleverly" <michael@xxxxxxxxxxxx>
- Date: Fri, 30 Jun 2006 23:59:43 -0600
On Sat, 1 Jul 2006, Fredderic wrote:
The problem, is what happens when I don't recognise the incoming data.
At the moment, the new connection handler checks the size of the
buffer, and dumps the connection if the buffer exceeds a certain size.
It also has a timeout going to dump the connection if it isn't
recognised in a certain time frame. What I would like to be able to
do, is start off with a list of all the known handlers, and knock them
off the list as they get ruled out. Then instead of having to fill a
buffer to a certain point or sit there waiting for a timeout
(which is what happens when someone telnets the server and messes up
their entry), I can dump the connection as soon as it runs out of
potential matches (the binary streams look like binary streams very
early on, so all non-matching text connections can be dumped at the
first end-of-line).
How compliated are the regular expressions in question? Do any use
alternation or positive/negative lookahead? Can you post a few examples?
Off the top of my head, I think one possible approach would be to
construct your regexps as a list of atoms/smaller patterns then you could
do [join $reList ""] to test w/regexp (or [lindex $reList 0] or [join
[lrange $reList 0 2] ""], etc.)
Thanks,
Michael
.
- References:
- Detecting potential regular expression matches?
- From: Fredderic
- Detecting potential regular expression matches?
- Prev by Date: Re: Strange construction
- Next by Date: http::geturl parse 1 line at a time after keyword?
- Previous by thread: Re: Detecting potential regular expression matches?
- Next by thread: http::geturl parse 1 line at a time after keyword?
- Index(es):
Relevant Pages
|