The match list

Any CQL file must have exactly one match list.

The match list contains keyword parameters that control the matching of each game.

The match list contains one or more position lists, each of which must match at least one position in the game in order for the match list to match that game.


The keyword parameters of the match list are:


This takes one parameter which denotes the name of the PGN file to search games for.

A malformed PGN file may cause CQL to crash.


This takes one parameter which denotes the name of the PGN file to output the results to.


This takes a range specifier denoting the range of years that the game must match.


This takes a single parameter specifying the required result of the game.

The allowed parameters are 1/2-1/2 , 1-0 , and 0-1 .

They denote respectively a drawn game, a game in which white wins, and a game in which black wins.

The parameter 1/2-1/2 may be abbreviated to 1/2 .



This takes a range specifier. Only games whose number within the PGN file lies within the range specifier are considered.


This takes one parameter, a string. Only games at least one of whose players names has as substring the given parameter will match.

The string matching is case-insensitive.


This takes two parameters, a tag name and a piece designator. See CQL Tagging.

Example of match list

Here is a match list that uses each parameter except :forany.

It has one empty position list as well.

 :pgn heijden.pgn
 :output out.pgn
 :player costeff
 :result 1-0
 :gamenumber 10 1000
 :year 1934 2000

This match list will look in games 10 through 1000 in heijden.pgn which end in a white win and were played (or composed) between 1934 and 2000, by any player whose name matches "costeff".