Open and close bracketSometimes referred to as square brackets, There are two brackets: the open ( [ ) and close ( ] ) bracket. The open bracket has an open end towards the right, and the close bracket has an open end towards the left. Brackets are the two keys found to the right of the P key on a US QWERTY keyboard.

Brackets can be used in a variety of ways, including a basic textual manner to add additional or missing details ("It was an honor to do it [the presentation].") Brackets are used in the Regular expressions, SQL, Visual Basic, C#, and JavaScript programming languages to enclose characters for string validation, pattern matching, or to build arrays. They are also used in mathematics, including standard notations for intervals and floor functions, as well as in the Lie bracket and Iverson bracket.

Regular expression example

$value = s/[a-z]/-/ig;

JavaScript programming example

var myList = new Array();
myList[0] = "value1";
myList[1] = "value2";
myList[2] = "value3";

SQL programming example

FROM customers
WHERE name LIKE '[M-Z]inger'

Related pages

Also see: Curly bracket, Keyboard terms, Programming terms