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: ., _, :, &, <, >, >=, =, =?, ==, !=, +, *, %, /, -, ~, |, {}, #, +=, -=, /=, *=, %=, ~~, [],

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
attackedbyset/set _ attackedby k
attacksset/setA attacks k
BB==2
bb==2
between(set set)between(R k)
blackblack
btmbtm
checkcheck
child(number)child(3)
childchild
colortypesetcolortype d4
comment(filter...)comment("x is" x)
connectedpawnsconnectedpawns
consecutivemovesrange
quiet
(position position)consecutivemoves(source target)
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
allfind quiet
<--
filterfind check
find all check
flipcountfilterflip Ad4 attacks k
flipcolorcountfilterflipcolor A attacks k
fliphorizontalcountfilterfliphorizontal Ae1 attacks k
flipverticalcountfilterflipvertical Ae1 attacks k
function{filter}function square(x) {x * x}
gamenumbergamenumber==1000
hascommentstringhascomment "good" (deprecated)
Heijden database VI interfacesee documentationhhdb composer "Reti"
hhdb sort award
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)
leftrangesetleft P
lightsetlight B==2
linefirstmatch
lastposition
singlecolor
nestban
primary
range
secondary
quiet
filterline-->move promote A-->mate
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)
movecapture
castle
comment
count
enpassant
enpassantsquare
from
legal
null
o-o
o-o-o
previous
primary
promote
pseudolegal
secondary
to
move from K to _
movenumbermovenumber>100
NN==2
nn==2
northeastrangesetnortheast P
northwestrangesetnorthwest P
notfilternot mate
notransformfilternotransform a4
orfilter/filtercheck or stalemate
originalcommentstringoriginalcomment "good"
PP==2
pp==2
parentparent:check
passedpawnspassedpawns>= 6
persistentquietvariable=numberpersistent x=5
piecein
all
filterpiece x in A x attacks k
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
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
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
truetrue
typesettype d4
unbindvariable
dictionary
dictionary[string]
unbind X
unbind Dict["ch"]
uprangesetup P
lowercasestringlowercase "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