I realize they're not equivalent, but for the purposes to which we're putting them, they might as well be.
-- Regards, Doug Miller
For a copy of my TrollFilter for NewsProxy/Nfilter, email me at filterinfo-at-milmac-dot-com
I realize they're not equivalent, but for the purposes to which we're putting them, they might as well be.
-- Regards, Doug Miller
For a copy of my TrollFilter for NewsProxy/Nfilter, email me at filterinfo-at-milmac-dot-com
The first one is noticeably faster, although not grossly so.
In the first case, the '[Yy]' drops out of consideration as soon as a 'y' is encountered. Only a 'set membership' test is required on the subsequent characters.
In the second instance, after the initial 'y' is encountered, a subsequent character _could_ be (1) a continuation of the 1st token (another 'y'), or it could be (2) the initial part of the next token ("not a letter"), or it could (3) be a 'not match'. You _have_ to make *both* tests (1) and (2) on each character following every 'y' -- because there could be 'something else' following the "not a letter" test that would invalidate one presumption but not the other
Contemplate something (nonsensical!) like the regex "[Yy]+[yY]+" and the string "xxYYYyyzz".
Yes, the regex _does_ generate a match on that string -- starting at the character immediately after the 2nd 'x'.
Now the mighty question rises, _which_ of the characters between the 'x' and 'z' match with *which* of the two tokens in the regex?
The first one clearly matches the first "[]+" token,
And since we _do_ have a match (you can trust me on that :), one of the four subsequent letters must match the 2nd "[]+" token. But _which_ one?
The "internal processing" of regular expression match checking is *MESSY*!! And a hell of a lot more complicated than it initially appears.
Thanks. [snip explanation]
I'm gonna guess that it's the second lower-case y, as the character immediately following that is not a match.
Is there a prize if I'm right?
-- Regards, Doug Miller
For a copy of my TrollFilter for NewsProxy/Nfilter, email me at filterinfo-at-milmac-dot-com
Yes, the overall match covers all the 'y' characters, regardless of case. The question I meant to pose is "which token matches _which_ characters?"
Is it a one-character match for the first token, and four for the second, or two and three, or three and two, or four and one?
For extra credit, _when_ is that determination made, and on what basis?
If you're into musical instruments, I've got a spare set of hardware for an air guitar I could liberate. You'll have to pick up the shipping charges though.
Thanks Doug.
I've found that Stop/Start occasionally will not load the new *.dat file and this bit me earlier last week.
Art
I haven't seen that -- however, I have, several times, had to shut down and restart the *client* when simply disconnecting and reconnecting didn't work. Go figure...
-- Regards, Doug Miller (alphageek-at-milmac-dot-com)
For a copy of my TrollFilter for NewsProxy/Nfilter, send email to autoresponder at filterinfo-at-milmac-dot-com
Have something to add? Share your thoughts — no account required.
Ask the community — no account required