The hascomment filter takes a single argument that must be a quoted string:
    hascomment "Good move!"
It matches a position if the comment for that position has a substring that is equal to the argument string of the filter. A comment in a position is considered to be the comment to the position's preceding move.