brackets
The square brackets[
and ]
have four functions in CQL
- In a textual regular expression, to denote a class of characters:
"mate in 29"~~[a-z ]+[0-9]+
- In a [ and ] in piece designators, to denote a class of pieces or squares
K[a1,b3] Q[a-h1-5] [QRBN]a2 attacks [qrbn][a1-8]
- In string index to contain and index or range of indices into a string:
"stalemate"[3] "mate"[1:5]
- The [] symbol denotes the empty set:
x=[]