The following regular expressions can be used to search documents for parentheses.
Paste the following regular expression to the "Find what" box of the Find/Replace panel of the Control Board to match any text in parentheses in your document:
\([!()]{0,}\)
For example, this expression would match the text highlighted below:
Marilyn Monroe (born Norma Jeane Mortenson) was as iconic as her life was tragic.
\(|[!()]{0,}|\)
For example:
Marilyn Monroe (born Norma Jeane Mortenson) was as iconic as her life was tragic.
With the following "find what" pattern:
\(([!()]{0,})\)
and the following "replace with" pattern:
[\1]
you could replace parentheses:
The study participants showed no improvement in cholesterol levels (McLellan and Frost, 2012).
with square brackets:
The study participants showed no improvement in cholesterol levels [McLellan and Frost, 2012].
With the following "find what" pattern:
\(([!()]{0,})\)
and the following "replace with" pattern:
{\1}
you could replace parentheses:
The study participants showed no improvement in cholesterol levels (McLellan and Frost, 2012).
with figure brackets:
The study participants showed no improvement in cholesterol levels {McLellan and Frost, 2012}.
With the following "find what" pattern:
(^w)\(([!()]{0,})\)(^w)
and the following "replace with" pattern:
,\1\2,\3
you could replace parentheses:
Marilyn Monroe (born Norma Jeane Mortenson) was as iconic as her life was tragic.
with commas:
Marilyn Monroe, born Norma Jeane Mortenson, was as iconic as her life was tragic.
With the following "find what" pattern:
(^w)\(([!()]{0,})\)(^w)
and the following "replace with" pattern:
\1— \2 —\3
you could replace parentheses:
Marilyn Monroe (born Norma Jeane Mortenson) was as iconic as her life was tragic.
with long dashes:
Marilyn Monroe — born Norma Jeane Mortenson — was as iconic as her life was tragic.
\([!()]{0,}\([!()]{0,}\)[!()]{0,}\)
For example:
Australia's Parliament House (architects Mitchell/Giurgola & Thorp (New York)) opened on 9 May 1988.
\([!()]{0,}\(|[!()]{0,}|\)[!()]{0,}\)
For example:
Australia's Parliament House (architects Mitchell/Giurgola & Thorp (New York)) opened on 9 May 1988.
With the following "find what" pattern:
(\([!()]{0,})\(([!()]{0,})\)([!()]{0,}\))
and the following "replace with" pattern:
\1[\2]\3
you could replace nested (interior) parentheses:
Australia's Parliament House (architects Mitchell/Giurgola & Thorp (New York)) opened on 9 May 1988.
with square brackets:
Australia's Parliament House (architects Mitchell/Giurgola & Thorp [New York]) opened on 9 May 1988.
With the following "find what" pattern:
(\([!()]{0,}^w)\(([!()]{0,})\)(^w[!()]{0,}\))
and the following "replace with" pattern:
\1— \2 —\3
you could replace nested (interior) parentheses:
Fauna populations declined in industrial areas (pollinators in the study (bees and hummingbirds) were tracked separately).
with long dashes:
Fauna populations declined in industrial areas (pollinators in the study — bees and hummingbirds — were tracked separately).
Note: Before searching with a regular expression, make sure that the "Use wildcards" option is enabled in the Find/Replace panel of the Control Board:
or in the Find/Replace dialog:
Tip:
See also...