mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jul 2006
Posts: 4,149
W
Wims Offline OP
Hoopy frood
OP Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,149
It looks like the fix for \K from jaytea's report broke regex support:
Code:
//echo -a $regex(56 233 48 48 ,/(\d+)(?: |$)/g) $regml(1) $regml(2)
$regml(2) should be 233


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Feb 2006
Posts: 546
J
Fjord artisan
Offline
Fjord artisan
J
Joined: Feb 2006
Posts: 546
it may be helpful to mention that this is only affecting the first iteration of the g-option implementation:

Code:
//echo -a $regsubex(abcde, /./g, x)


produces "xbxxx".

we can further observe that the second match is only detected correctly when it doesn't immediately follow the first:

Code:
//echo -a $regex(abcdef, /abc|e|f/g) - $regex(abcdef, /abc|d|f/g)


produces "3 - 2".

it appears that the "offset advance by 1" measure added to the demo code to protect against infinite loops when \K is used in lookbehinds is being triggered for all cases in the first iteration of the loop.

pure speculation: the workaround for get_startchar() may involve a variable that doesn't get initialized before the loop, so its first use is bugged.


"The only excuse for making a useless script is that one admires it intensely" - Oscar Wilde
Joined: Dec 2002
Posts: 5,420
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,420
Thanks for your bug report. This issue has been fixed for the next version.

Joined: Jul 2006
Posts: 4,149
W
Wims Offline OP
Hoopy frood
OP Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,149
Thanks, is it possible to get a new beta quickly with this fix, as it's breaking my scripts heavily and I'd rather keep using the betas?


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Apr 2010
Posts: 969
F
Hoopy frood
Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 969
I agree with wims here. Can't test the beta as many of my scripts break due to this issue


I am SReject
My Stuff

Link Copied to Clipboard