mIRC Home    About    Download    Register    News    Help

Print Thread
#155131 03/08/06 11:56 PM
Joined: May 2006
Posts: 27
A
Ameglian cow
OP Offline
Ameglian cow
A
Joined: May 2006
Posts: 27
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...


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

#155133 05/08/06 12:03 AM
Joined: May 2006
Posts: 27
A
Ameglian cow
OP Offline
Ameglian cow
A
Joined: May 2006
Posts: 27
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


Suchorski @ FreeNode
#155134 05/08/06 07:30 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
\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: 759
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Apr 2004
Posts: 759
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.

$maybe
#155136 05/08/06 09:25 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
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
Joined: May 2006
Posts: 27
A
Ameglian cow
OP Offline
Ameglian cow
A
Joined: May 2006
Posts: 27
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


Suchorski @ FreeNode
#155138 06/08/06 05:53 AM
Joined: Jul 2003
Posts: 655
Fjord artisan
Offline
Fjord artisan
Joined: Jul 2003
Posts: 655
Dave: \n can be using for ascending order, will replace a match with its match number.


"Allen is having a small problem and needs help adjusting his attitude" - Flutterby
#155139 07/08/06 04:01 PM
Joined: Dec 2002
Posts: 5,420
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,420
Thanks the \0 parameter has been fixed for the next version.

#155140 08/08/06 04:36 PM
Joined: May 2006
Posts: 27
A
Ameglian cow
OP Offline
Ameglian cow
A
Joined: May 2006
Posts: 27
thank you


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


$maybe

Link Copied to Clipboard