Hi,
Your code would also work to some extent, I guess.
We could put all the text in the Tk window in a scalar
variable, and do a regex match with the string stored
in that variable.
Your offset value of '27' would give me the character
number of the starting point of the word.But I would
also
need the line number if I am to do something further with
the word, for example change the color of the word using code like this:
$t->tagConfigure("wrong",-foreground=>"red");
$t->tagAdd("wrong","$start","$end_pt");
Tk text widget indices are of the form:
line no.char no, chars begin at 0, lines begin at 1
i.e. I would need => line no.27
Thanx for the regex bit of code anyway.
:)