Okay, I have implemented the changes and they resolve the infinite loop issue. However, they also break one of the \K examples you provided some years ago, which is one of my test cases:

Code:
text = abc
pattern = /(?=.\K)/
replace = X

Expected "aXabc". But now returns "abc".

Unfortunately, I have nothing to compare these results against because none of the regular expression testers I have tried handle \K properly.

Here are the test cases I have for \K, which were provided by you or others in the past:

Code:
text = abcd
pattern = /.\K/g
replace = <>
expect = 

text = abc
pattern = /(?=.\K)/
replace = X
expect = 

text = abc
pattern = /(?<=\K.)/
replace = X
expect = 

text = abcd
pattern = /.\K/
replace = <>
expect = 

; previously resulted in infinite loop
text = abcd
pattern = /.\K/g
replace = <>
expect = 

; previously resulted in infinite loop
text = abc
pattern = /(?<=\K.).*/g
replace =
expect =

; previously resulted in infinite loop
text = abc
pattern = /(?=.\K)/g
replace = X
expect =

Can you fill in the "expect=" value for each item so that I can confirm whether mIRC is reporting the correct result? Or better yet, provide a link to a regex tester that returns the correct results?