mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
#38312 25/07/03 10:12 PM
S
ScatMan
ScatMan
S
i don't understand why (a+)* matches 33 times in "aaaa" ?

#38313 25/07/03 10:19 PM
C
codemastr
codemastr
C
Umm, what are you talking about?

//echo -a $regex(aaaa,/(a+)*/g)
result:
2

Thats a big difference from 33.

#38314 25/07/03 10:23 PM
S
ScatMan
ScatMan
S
i dunno that's what man.txt says, i meant that it trying to match in 33 posibilities.

#38315 26/07/03 08:52 AM
S
ScatMan
ScatMan
S
??

#38316 26/07/03 09:09 AM
Joined: Mar 2003
Posts: 1,256
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,256
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.

#38317 26/07/03 09:50 AM
S
ScatMan
ScatMan
S
please stop replying to me!!



#38318 26/07/03 10:29 AM
Joined: Mar 2003
Posts: 1,256
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,256
Then stop asking these stupid questions.

#38319 26/07/03 12:55 PM
S
ScatMan
ScatMan
S
if u don't know the answer it doesn't mean it's a stupid question


#38320 26/07/03 01:34 PM
Joined: Mar 2003
Posts: 1,256
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,256
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 .

#38321 26/07/03 01:46 PM
S
ScatMan
ScatMan
S
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.







#38322 26/07/03 02:47 PM
Joined: Dec 2002
Posts: 2,958
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Dec 2002
Posts: 2,958
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.

#38323 26/07/03 03:31 PM
C
codemastr
codemastr
C
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.

#38324 26/07/03 04:15 PM
S
ScatMan
ScatMan
S
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"

#38325 26/07/03 05:21 PM
Joined: Dec 2002
Posts: 3,015
P
Hoopy frood
Offline
Hoopy frood
P
Joined: Dec 2002
Posts: 3,015
You cannot dictate who will answer you. I strongly suggest you reboot your attitude if you expect anyone to help you.

#38326 26/07/03 05:27 PM
S
ScatMan
ScatMan
S
locotusofborg doesn't even trying to help me

#38327 26/07/03 05:35 PM
C
codemastr
codemastr
C
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.

#38328 26/07/03 06:00 PM
P
pheonix
pheonix
P
coz your an ignorant fool.

#38329 26/07/03 06:01 PM
S
ScatMan
ScatMan
S
i didn't say i don't know regex, i just don't understand it when it's nested quantifiers like (a+)*


#38330 26/07/03 06:37 PM
C
codemastr
codemastr
C
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.

#38331 26/07/03 07:53 PM
Joined: Mar 2003
Posts: 1,256
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,256
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....

Page 1 of 2 1 2

Link Copied to Clipboard