in reply to Re^4: Tags in TK Text widgets
in thread Tags in TK Text widgets

I don't use Tk, but to me it looks like a problem of using double quotes where you should be using single quotes. eg. try $ts_box->FindAndReplaceAll(-regexp, -nocase, '[\n]', '%');

I expect you don't need the square brackets either, FWIW.


🦛

Replies are listed 'Best First'.
Re^6: Tags in TK Text widgets
by colintu (Acolyte) on Aug 17, 2024 at 16:41 UTC

    Unfortunately that didn't make any difference and neither did leaving out the square brackets.

    I seem to remember there is something special about trying to match \n because matches are line based and \n is after the end of the match range or something weird like that.