This table lists the filters in CQL as well as parameters or keywords each filter uses. This table is not normative: consult the documentation for the filter for the normative definition.

This table does not include symbolic filters: ――, ., _, :, &, <, >, >=, , =, =?, ==, !=, , +, *, %, /, -, ~, |, {}, #, +=, -=, /=, *=, %=, ~~, [], . For unicode symbols, see unicode symbols.

Deprecated filters are crossed out.

Table of Filters

Nameparametersargumentsexample
AA==2
aa==2
absnumberabs #A - #a
ancestor(position position)ancestor(source target)
andfilter/filtercheck and Q==2
asciistring or numberX=ascii "A"
Y=ascii 65
assertfilterassert X==0
atomic variablesvariableatomic X=1
attackedbyset/set _ attackedby k
attacksset/setA attacks k
BB==2
bb==2
between(set set)between(R k)
blackblack
btmbtm
castlecastle
checkcheck
child(number)child(3)
childchild
colortypesetcolortype d4
comment(filter...)comment("x is" x)
connectedpawnsconnectedpawns
consecutivemovesrange
quiet
(position position)consecutivemoves(source target)
countmoves―― filter
legal ―― filter
pseudolegal ―― filter
countmoves legal ――
currentmove filter―― filternot currentmove ――=
currentpositioncurrentposition
currenttransformcurrenttransform
darksetdark B
dateimplicit search parameterdate~~"199[5-9]"
depthdepth>4
descendant(position position)descendant(source target)
dictionarydictionary X["a"]="bc"
distance(position position)distance(source target)
doubledpawnsdoubledpawns>= 4
downrangesetdown P
echoin
all
echo quiet
(variable variable)echo(s t)s&t==.
ecoimplicit search parameterX=eco
elowhite
black
elo>2700
eventimplicit search parameterx=event
eventdateimplicit search parametereventdate~~"199[4-7]"
falsefalse
fenstringX=fen
filesetfile K
findrange
all
quiet
<--
filterfind check
find all check
flipcountfilterflip Ad4 attacks k
flipcolorcountfilterflipcolor A attacks k
fliphorizontalcountfilterfliphorizontal Ae1 attacks k
flipverticalcountfilterflipvertical Ae1 attacks k
fromx=from
function{filter}function square(x) {x * x}
gamenumbergamenumber==1000
hascommentstringhascomment "good" (deprecated)
Heijden database VI interfacesee documentationhhdb composer "Reti"
hhdb sort award
idealmateidealmate
idealstalemateidealstalemate
iftestfilter consequentif check "In check"
iftestfilter consequent else elsefilterif check "In check" else "safe"
inset/setR in (A attacks k)
instring/string"Q" in fen
indexofstring stringindexof("King" "a King")==2
initialinitial
initialpositioninitialposition:check
intstringint "64" == 64
isboundisbound Foo
isolatedpawnsisolatedpawns>3
isunboundisunbound Foo
KK attacks n
kk attacks n
lca(position position)lca(source target)
legal―― filterlegal ――a-h4
leftrangesetleft P
pseudolegal―― filterpseudolegal ――a-h4
lightsetlight B==2
linefilterline-->move promote A-->mate
localdictionarylocal dictionary D
loopfilterloop {child(i) i+=1}
lowercasestringlowercase "Tal"=="tal"
mainlinemainline
makesquare(number number)makesquare(File Rank)
matemate
max(number number)max(#R #Q)
messagemessage quiet(filter...)message("x is " x)
min(number number)min(#R #Q)
modelmatemodelmate
modelstalematemodelstalemate
movemove from K to _
movenumbermovenumber>100
NN==2
nn==2
northeastrangesetnortheast P
northwestrangesetnorthwest P
notfilternot mate
notransformfilternotransform a4
nullmovenullmove
o-oo-o
o-o-oo-o-o
orfilter/filtercheck or stalemate
originalcommentstringoriginalcomment "good"
PP==2
pp==2
parentparent:check
passedpawnspassedpawns>= 6
/ pathprimary
focus (or )
max
verbose
keepallbest
title
piecepath
quiet
nestban
firstmatch
lastposition
variouspath -- check +
pathcountpathcount
pathcountunfocusedpathcountunfocused
pathlastpositionpathlastposition
pathstatuspathstart
persistentquietvariable=numberpersistent x=5
piecein
all
filterpiece x in A x attacks k
piecenamesetpiecename d4
piece assignmentvariable=setpiece x = K
pieceidsetpieceid x
pinfrom
through
to
pin from Q
player
player white
player black
implicit search parameterplayer "Kasparov"
player white ~~ "Kas.*ov"
x=player black
plyply>100
positionnumberposition 0
positionidpositionid == 0
powersetpower A<5
primaryprimary
pseudolegal―― filterpseudolegal ――a-h4
purematepuremate
purestalematepurestalemate
QQ==2
qq==2
RR==2
rr==2
ranksetrank K == rank k
ray direction (set...)ray (R a k)
readfilestringX=readfile "a.cqo"
removecommentremovecomment
resultstringresult "1-0"
reversecolorcountfilterreversecolor A attacks k
rightrangesetright P
rotate45countfilterrotate45 A attacks right k
rotate90countfilterrotate90 A attacks up k
secondarysecondary
settag(quoted string string or int)settag("MyTag" "blunder")
shiftcountfiltershift A e1 attacks kg1
shifthorizontalcountfiltershifthorizontal Ae1 attacks kg1
shiftverticalcountfiltershiftvertical Ae1 attacks kg1
sidetomovesidetomove==white
siteimplicit search parametersite "Berlin"
x=site
sortmin
documentation
number or setsort "Material" power A
sqrtnumbersqrt 10000
squarein
all
filtersquare s in _ k attacks s
stalematestalemate
str(filter...)X=str("K on: " K)
tagquoted stringtag "UTCDate"
terminalterminal
toy=to
truetrue
trytry
typesettype d4
typenamesettypename d4
unbindvariable
dictionary
dictionary[string]
unbind X
unbind Dict["ch"]
uprangesetup P
uppercasestringuppercase "tal"=="TAL"
variationvariation
virtualmainlinevirtualmainline
while: standard form(test)bodywhile(x<3){z+=1 x+=1}
while: ~~ form(target~~pattern)bodywhile(player~~".")...
whitewhite
writefile(filename contents)writefile("a.cqo" fen)
wtmwtm
xray(set...)xray(R a k)
yearyear>2000