mIRC Home    About    Download    Register    News    Help

Print Thread
#155131 03/08/06 11:56 PM
A
Asterix_UO
Asterix_UO
A
Hey

I'm from Brazil and I not speak english very well, I wait that you they understand me...

On mIRC 6.17 the $regsubex return this
$regsubex(Test,/(.)/g,\0) return 4444 (number of matches)

On mIRC 6.2 the $regsubex return this
$regsubex(Test,/(.)/g,\0) return 4321 (number of remain matches)

The \0 on help says it: "0 = number of matches"

Then the correct one is in the mIRC 6.17, but \0 of the mIRC 6.2 is well util and could be replace by one \r and the \0 fixed...

Thank You...

#155132 04/08/06 11:35 AM
Joined: Dec 2002
Posts: 3,840
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 3,840
Can you provide a short script of a few lines that reproduces this problem?

#155133 05/08/06 12:03 AM
A
Asterix_UO
Asterix_UO
A
type this in the mIRC 6.17:
//echo -a $regsubex(Test,/(.)/g,\0)
its will return 4444 (correct)





now type this in the mIRC 6.2:
//echo -a $regsubex(Test,/(.)/g,\0)
its will return 4321 (incorrect)



sorry for my english...

thanks

#155134 05/08/06 07:30 AM
D
DaveC
DaveC
D
\0 = number of matches

And TEST => 4321 is the number of matches at that inserted position

Would seem to make more sence to me the way it is in 6.20.

#155135 05/08/06 08:22 AM
Joined: Apr 2004
Posts: 755
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Apr 2004
Posts: 755
I have to disagree that 4321 is the expected output for \0, Nowhere does it state its the total matches at that position in the help file. Concidering mIRC's own behaviour with 0 in identifiers 4444 is the expected output.
\0 returning 4321 is pretty a confusing result for \0, but i do think another special substitute character might be in place for it becouse knowing the remaining number of matches can be a powerful trick in substituting.
\0 is a value that shouldnt change as it should stand for total matches the regex made regex.

Especially concidering the alternative youd have to use to get that number now is to precache the regex and use $regml(0) as replacement text which totally defeats the main purpose of regsubex in my eyes.

Adding on to this (and not waste another topic :tongue:) there should be a nonspaced version of \a (\A?).
so $regsubex(Test,/(.)/g,\A) returns TestTestTestTest

Last edited by Mpdreamz; 05/08/06 08:36 AM.
#155136 05/08/06 09:25 AM
D
DaveC
DaveC
D
never really said it was "right" just it seemed to make more sence, than having an identifier that held the total matches, as i couldnt see a large scale purpose of subsituting the total matches over and over, while i could see a use of a descending count (ascending wiould be more usefull but still atleat the match points would be refrenceable using a descending one)

Of course if as u said a seperate directive for each, well that would be even better.

PS: my understanding of regex is very limited , so im looking at this from a very simple point of view, please excuse any facts i am unaware of (ie; if that can already be done)

#155137 05/08/06 01:43 PM
A
Asterix_UO
Asterix_UO
A
hey Mpdreamz...
I'm in accordance with you, the version of nonspaced \a is very useful substitute character...

the \0 returning the remaning matchs it could be changed for the new special substitute character and the \0 fixed...

tks and sorry for my english...

good bye

#155138 06/08/06 05:53 AM
O
Om3n
Om3n
O
Dave: \n can be using for ascending order, will replace a match with its match number.

#155139 07/08/06 04:01 PM
Joined: Dec 2002
Posts: 3,840
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 3,840
Thanks the \0 parameter has been fixed for the next version.

#155140 08/08/06 04:36 PM
A
Asterix_UO
Asterix_UO
A
thank you

#155141 24/11/06 12:31 AM
Joined: Apr 2004
Posts: 755
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Apr 2004
Posts: 755
Thanks for adding \A Khaled cool


Link Copied to Clipboard