mIRC Homepage
Posted By: Asterix_UO $regsubex bug - 03/08/06 11:56 PM
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...
Posted By: Khaled Re: $regsubex bug - 04/08/06 11:35 AM
Can you provide a short script of a few lines that reproduces this problem?
Posted By: Asterix_UO Re: $regsubex bug - 05/08/06 12:03 AM
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
Posted By: DaveC Re: $regsubex bug - 05/08/06 07:30 AM
\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.
Posted By: Mpdreamz Re: $regsubex bug - 05/08/06 08:22 AM
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
Posted By: DaveC Re: $regsubex bug - 05/08/06 09:25 AM
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)
Posted By: Asterix_UO Re: $regsubex bug - 05/08/06 01:43 PM
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
Posted By: Om3n Re: $regsubex bug - 06/08/06 05:53 AM
Dave: \n can be using for ascending order, will replace a match with its match number.
Posted By: Khaled Re: $regsubex bug - 07/08/06 04:01 PM
Thanks the \0 parameter has been fixed for the next version.
Posted By: Asterix_UO Re: $regsubex bug - 08/08/06 04:36 PM
thank you
Posted By: Mpdreamz Re: $regsubex bug - 24/11/06 12:31 AM
Thanks for adding \A Khaled cool
© mIRC Discussion Forums