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
♔[a1,b3] ♕[a-h1-5] ♕♖♗♘a2→♛♜♝♞][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=[]