hascomment

The hascomment filter takes a single argument that must be a quoted string:
    hascomment "Good move!"
The hascomment filter matches a position if the PGN file contains a comment for that position which has a substring that is equal to the argument. A comment for a position in a PGN file is considered to be a comment to the move leading to that position.

Numeric Annotation Glyphs (NAGs)

The PGN specification allows moves to be annotated with "numeric annotation glyphs", or NAGs. These take the form of $ immediately followed by a positive integer smaller than 256, such as $2 or $5.

If the argument to hascomment consists of the character $ immediately followed by one or more digits, then hascomment searches for the corresponding NAG.

If the argument to hascomment is equal to the CQL equivalent of a NAG value listed in the following table, then hascomment searches fo the corresponding NAG:
chess representationCQL representationNAG number
!!1
??2
!!!!3
????4
!?!?5
?!?!6
==10
+/=14
=/+15
±+/-16
-/+17
+−+-18
−+-+19

For example,

  hascomment "?"
will match a position whose preceding move is annotated with the NAG of 2. It has the identical effect to
  hascomment "$2"

Likewise,

  hascomment "+/="
will match a position whose preceding move is annotated with the NAG of 14, and is equivalent to
  hascomment "$14" 

The treatment of NAGs in CQL is currently experimental.