#7630

thr
Member

Yes, a positive lookahead only matches, it doesn’t “consume” anything. But you can simplify your whole construct like so:

document.selection.Replace("(<(denk|wil|dacht|kan|wilde|ben|zie)je>","1 je",eeFindNext | eeReplaceAll | eeFindReplaceRegExp);

That way you don’t need to pay attention to matching the word separators at all. That gives you a lot more leeway. For example, you can then have something like

denkje, wilje;dachtje-kanje
wildeje/zieje

and it will still work as intended, while keeping all word separators intact.

Even more simpler with the word shorthand class:

document.selection.Replace("(<(w+)je>","1 je",eeFindNext | eeReplaceAll | eeFindReplaceRegExp);