|
Joined: May 2003
Posts: 730
Hoopy frood
|
OP
Hoopy frood
Joined: May 2003
Posts: 730 |
i don't understand why (a+)* matches 33 times in "aaaa" ?
|
|
|
|
Joined: Dec 2002
Posts: 2,809
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 2,809 |
Umm, what are you talking about?
//echo -a $regex(aaaa,/(a+)*/g) result: 2
Thats a big difference from 33.
|
|
|
|
Joined: May 2003
Posts: 730
Hoopy frood
|
OP
Hoopy frood
Joined: May 2003
Posts: 730 |
i dunno that's what man.txt says, i meant that it trying to match in 33 posibilities.
|
|
|
|
Joined: May 2003
Posts: 730
Hoopy frood
|
OP
Hoopy frood
Joined: May 2003
Posts: 730 |
|
|
|
|
Joined: Mar 2003
Posts: 1,271
Hoopy frood
|
Hoopy frood
Joined: Mar 2003
Posts: 1,271 |
Learn regular expressions properly. There's plenty of tutorials available on the web. Regular expressions atre NOT something specific to mIRC, khaled just gave mIRC the ability to use them.
DALnet #Helpdesk I hear and I forget. I see and I remember. I do and I understand. -Confucius
|
|
|
|
Joined: May 2003
Posts: 730
Hoopy frood
|
OP
Hoopy frood
Joined: May 2003
Posts: 730 |
please stop replying to me!!
|
|
|
|
Joined: Mar 2003
Posts: 1,271
Hoopy frood
|
Hoopy frood
Joined: Mar 2003
Posts: 1,271 |
Then stop asking these stupid questions.
DALnet #Helpdesk I hear and I forget. I see and I remember. I do and I understand. -Confucius
|
|
|
|
Joined: May 2003
Posts: 730
Hoopy frood
|
OP
Hoopy frood
Joined: May 2003
Posts: 730 |
if u don't know the answer it doesn't mean it's a stupid question
|
|
|
|
Joined: Mar 2003
Posts: 1,271
Hoopy frood
|
Hoopy frood
Joined: Mar 2003
Posts: 1,271 |
You are asking someone here to explain to you how regular expressions work. Not only is that not a mIRC scripting question, as regular expressions existed long before mIRC did, you also obviously have not taken the time to read toturials that can be found on the internet about regular expressions, of which there are plenty, nor have you searched this forum, as there are numerous references about using regular expressions. If I recall, Hammer made reference to a log of a class he gave on regular expressions not too long ago. If I'm wrong, follow this link to get there: http://helpdesk.zaz.net/channel/classes/basic-regex.txt .
DALnet #Helpdesk I hear and I forget. I see and I remember. I do and I understand. -Confucius
|
|
|
|
Joined: May 2003
Posts: 730
Hoopy frood
|
OP
Hoopy frood
Joined: May 2003
Posts: 730 |
actually i already know the basics about regex and i took the time to read several tutorials, but sometimes i don't understand something that i read and i ask it here and get help. now shut up and stop replying with your stupid posts.
|
|
|
|
Joined: Dec 2002
Posts: 2,985
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 2,985 |
It's not possible or conventional to choose who answers a question. The question should be answered by the people that best know the answer to that question. That seems to be the case here.
|
|
|
|
Joined: Dec 2002
Posts: 2,809
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 2,809 |
You already got your answer, it does NOT match 33 times. If you don't like that answer, well then you've got a problem, because that IS the answer.
|
|
|
|
Joined: May 2003
Posts: 730
Hoopy frood
|
OP
Hoopy frood
Joined: May 2003
Posts: 730 |
not match 33 times, try 33 posibilities to match from man.txt: "Beware of patterns that contain nested indefinite repeats. These can take a long time to run when applied to a string that does not match. Consider the pattern fragment
(a+)*
This can match "aaaa" in 33 different ways"
|
|
|
|
Joined: Dec 2002
Posts: 3,127
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,127 |
You cannot dictate who will answer you. I strongly suggest you reboot your attitude if you expect anyone to help you.
ParaBrat @#mIRCAide DALnet
|
|
|
|
Joined: May 2003
Posts: 730
Hoopy frood
|
OP
Hoopy frood
Joined: May 2003
Posts: 730 |
locotusofborg doesn't even trying to help me
|
|
|
|
Joined: Dec 2002
Posts: 2,809
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 2,809 |
Do you understand the internals of regex matching? Regex is a very complex system, for me to explain to you why that happens accurately would require you to know a lot about regex. To put it this way, I'm currently studying the algorithm used by one regex library, and it is aboyt 70 pages of text, and that just describes the algorithm, not the entire regex system. It's not something I can just say "here is why it does that" It is a very complex process to explain.
|
|
|
|
Joined: May 2003
Posts: 2,265
Hoopy frood
|
Hoopy frood
Joined: May 2003
Posts: 2,265 |
coz your an ignorant fool.
new username: tidy_trax
|
|
|
|
Joined: May 2003
Posts: 730
Hoopy frood
|
OP
Hoopy frood
Joined: May 2003
Posts: 730 |
i didn't say i don't know regex, i just don't understand it when it's nested quantifiers like (a+)*
|
|
|
|
Joined: Dec 2002
Posts: 2,809
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 2,809 |
How about you read what I said? I didn't say you don't know regex, I said you don't know the INTERNALS of it. But seeing as how you refuse to listen, read http://perl.plover.com/Regex and then you might have enough understanding to figure out why that happens.
|
|
|
|
Joined: Mar 2003
Posts: 1,271
Hoopy frood
|
Hoopy frood
Joined: Mar 2003
Posts: 1,271 |
Of course I didn't go into it any deeper. Your question, and the reply you originally gave codemaster told me you weren't gonna grasp any answers. It would be like giving a 5 yr old who just learned the alphabet the collected works of Shakespeare....
DALnet #Helpdesk I hear and I forget. I see and I remember. I do and I understand. -Confucius
|
|
|
|
|