# Parenthesis

Alternatively referred to as the a **curved mark**, **open parenthesis** and **close parenthesis**. **Parenthesis** are an outward "(" or inward ")" curved line found on the "9" and "0" keys on a U.S. keyboard.
In the picture to the right is an example of an open and close parentheses.

## Where are the parentheses on the keyboard?

Below is an overview of a computer keyboard with the open and close parentheses highlighted in blue.

## How to create the '(' and ')' symbols

Creating the '(' and ')' symbols on a U.S. keyboard

To create a parenthesis using a U.S. keyboard hold down the Shift key and press the nine key at the top of the keyboard for an open parenthesis or the zero key for a close parenthesis.

Creating the '(' and ')' symbols on a smartphone or tablet

To create a tilde on a smartphone or tablet open the keyboard and go into the numbers (123) or symbols (sym) section and then press your finger on the '(' or ')' symbol.

## What are parentheses is used for on a computer?

- Enable writers to express remarks.
- Used for mathematical order of operations.
- In computer programming for grouping, capturing, and other tasks depending on the language.
- In regular expressions for grouping and capturing.
- Spreadsheet formulas.

## Parentheses in English writing

With English, the parentheses help explain a word, phrase, or sentence.

"I find it funny that she typed lol (laugh out loud) at the end of her e-mail."

## Parentheses in mathematical order of operation

With mathematics and the order of operations or associative operation, anything contained within parentheses is done first. For example, in the math problem below, you would first add "5 + 2" for "7" and then times "2" by "7" to get 14.

2 * ( 5 + 2)

## Computer programming parentheses

Below is an example of how parentheses may be used in an if statement, using the Perl programming language.

if ($test =~ /[a-zA-z]/) { print "It works!\n"; }

## Regular expression parentheses

With regular expressions, parentheses can be used to capture text. For example, in the below regular expression done in Perl the variable $piglatin takes anything beginning with "th" and moves it to the end of the line.

$piglatin =~ s/^(th)(.*)/\2\1/i;

## Parentheses in spreadsheet formulas

In the example below is how a formula using parentheses may appear in Microsoft Excel. In the example below, the formula adds cells A1 through A5 to get a total sum.

=sum(a1:a5)

## What is the difference between 'parenthesis' and 'parentheses'?

Parentheses is plural, and parenthesis is singular.

**Also see:** Programming terms