mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
regex #38312 25/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 don't understand why (a+)* matches 33 times in "aaaa" ?

Re: regex #38313 25/07/03 10:19 PM
Joined: Dec 2002
Posts: 2,809
C
codemastr Offline
Hoopy frood
Offline
Hoopy frood
C
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.

Re: regex #38314 25/07/03 10:23 PM
Joined: May 2003
Posts: 730
S
ScatMan Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: May 2003
Posts: 730
i dunno that's what man.txt says, i meant that it trying to match in 33 posibilities.

Re: regex #38315 26/07/03 08:52 AM
Joined: May 2003
Posts: 730
S
ScatMan Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: May 2003
Posts: 730
??

Re: regex #38316 26/07/03 09:09 AM
Joined: Mar 2003
Posts: 1,271
L
LocutusofBorg Offline
Hoopy frood
Offline
Hoopy frood
L
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
Re: regex #38317 26/07/03 09:50 AM
Joined: May 2003
Posts: 730
S
ScatMan Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: May 2003
Posts: 730
please stop replying to me!!



Re: regex #38318 26/07/03 10:29 AM
Joined: Mar 2003
Posts: 1,271
L
LocutusofBorg Offline
Hoopy frood
Offline
Hoopy frood
L
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
Re: regex #38319 26/07/03 12:55 PM
Joined: May 2003
Posts: 730
S
ScatMan Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: May 2003
Posts: 730
if u don't know the answer it doesn't mean it's a stupid question


Re: regex #38320 26/07/03 01:34 PM
Joined: Mar 2003
Posts: 1,271
L
LocutusofBorg Offline
Hoopy frood
Offline
Hoopy frood
L
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
Re: regex #38321 26/07/03 01:46 PM
Joined: May 2003
Posts: 730
S
ScatMan Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
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.







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

Re: regex #38323 26/07/03 03:31 PM
Joined: Dec 2002
Posts: 2,809
C
codemastr Offline
Hoopy frood
Offline
Hoopy frood
C
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.

Re: regex #38324 26/07/03 04:15 PM
Joined: May 2003
Posts: 730
S
ScatMan Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
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"

Re: regex #38325 26/07/03 05:21 PM
Joined: Dec 2002
Posts: 3,127
P
ParaBrat Offline
Hoopy frood
Offline
Hoopy frood
P
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
Re: regex #38326 26/07/03 05:27 PM
Joined: May 2003
Posts: 730
S
ScatMan Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: May 2003
Posts: 730
locotusofborg doesn't even trying to help me

Re: regex #38327 26/07/03 05:35 PM
Joined: Dec 2002
Posts: 2,809
C
codemastr Offline
Hoopy frood
Offline
Hoopy frood
C
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.

Re: regex #38328 26/07/03 06:00 PM
Joined: May 2003
Posts: 2,265
P
pheonix Offline
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
coz your an ignorant fool.


new username: tidy_trax
Re: regex #38329 26/07/03 06:01 PM
Joined: May 2003
Posts: 730
S
ScatMan Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
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+)*


Re: regex #38330 26/07/03 06:37 PM
Joined: Dec 2002
Posts: 2,809
C
codemastr Offline
Hoopy frood
Offline
Hoopy frood
C
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.

Re: regex #38331 26/07/03 07:53 PM
Joined: Mar 2003
Posts: 1,271
L
LocutusofBorg Offline
Hoopy frood
Offline
Hoopy frood
L
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
Page 1 of 2 1 2