mIRC Home    About    Download    Register    News    Help

Print Thread
Page 2 of 2 1 2
#38332 26/07/03 08:33 PM
Joined: Dec 2002
Posts: 109
T
Vogon poet
Offline
Vogon poet
T
Joined: Dec 2002
Posts: 109
Quote:
This can match "aaaa" in 33 different ways"


That would be because there are 33 combinations of the configuration (a+)* in that string. Consider..

(a)* (aa)* (aaa)* (aaaa)*

and those first three can match anywhere within the string.
Quite a number of possibilities.

You just wouldn't notice the difference because the only difference is the position the individual characters reside in memory. To the human eye, they are all "a".


<Ingo> I can't uninstall it, there seems to be some kind of "Uninstall Shield"
#38333 26/07/03 08:47 PM
Joined: Dec 2002
Posts: 109
T
Vogon poet
Offline
Vogon poet
T
Joined: Dec 2002
Posts: 109
(a+)*

can become any of:

(a)*
(aa)*
(aaa)*
(aaaa)*

and that can become (i have the whole string in black, the part the regex matches in red):

1. aaaa
2. aaaa
3. aaaa
4. aaaa

5. aaaa
6. aaaa
7. aaaa

8. aaaa
9. aaaa

10. aaaa

And that's just with the (a+) part.

If you add * to the equation... that's most of those above, another 2 or 3 or 4 times. We've already got 10 combinations.

Here is the extended version:

1a) aaaa
b) aaaa
c) aaaa
d) aaaa
2a) aaaa
b) aaaa
c) aaaa
3a) aaaa
b) aaaa

etc..
Some of these may look a lot alike to you, but in terms of processing and how they are matched, there are 33 ways to come up with that match.


<Ingo> I can't uninstall it, there seems to be some kind of "Uninstall Shield"
#38334 26/07/03 10:12 PM
Joined: May 2003
Posts: 730
S
ScatMan Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: May 2003
Posts: 730
i dunno.. i will try to read the tutorial codemastr gave

Page 2 of 2 1 2

Link Copied to Clipboard