in reply to how to use validatecommand for string checking

well, first of all, -validatecommand takes a sub ref (or one of the other valid callback forms), just as -invalidcommand does. So you'd write something like

$mw->Entry( -textvariable => \$content , -validate => 'key' , -validatecommand => sub { $_[0] =~ /^go / }, -invalidcommand => sub { print "ERROR.\n", $mw->bell() } )->pack() ;

However, for your purpose, it doesn't make sense to reject the edit entirely if the resulting string doesn't meet the criteria. Because if the entry starts out empty, the user doesn't even get a chance to type a g, let alone the following o. And I, as a user, don't like an interface which requires, without reason, that I type the command in a certain order. I should be able to enter most of the command line, and then go back and insert "go" at the beginning.

So, instead, what you should do is use the validity of the new value to enable/disable an "OK" (submit) command button.

A word spoken in Mind will reach its own level, in the objective world, by its own weight