Table of contents
Atlantis Word Processor logo
Atlantis Word Processor
Search


Tip  Did you know that ...


Atlantis can automatically safeguard copies of all open documents to a special folder. In the event of a fatal crash or accidental shutdown of your computer, Atlantis will be able to restore your documents from these Safe Copies. Click here for details...
Examples of regular expressions: searching for parentheses

The following regular expressions can be used to search documents for parentheses.

Search for text in 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.

Search for text in parentheses (not including the parentheses)

\(|[!()]{0,}|\)

For example:

Marilyn Monroe (born Norma Jeane Mortenson) was as iconic as her life was tragic.

Replace parentheses with square brackets

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].

Replace parentheses with figure brackets

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}.

Replace parentheses with commas

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.

Replace parentheses with long dashes

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 Monroeborn Norma Jeane Mortensonwas as iconic as her life was tragic.

Search for nested (double) parentheses

\([!()]{0,}\([!()]{0,}\)[!()]{0,}\)

For example:

Australia's Parliament House (architects Mitchell/Giurgola & Thorp (New York)) opened on 9 May 1988.

Search for text inside nested (interior) parentheses

\([!()]{0,}\(|[!()]{0,}|\)[!()]{0,}\)

For example:

Australia's Parliament House (architects Mitchell/Giurgola & Thorp (New York)) opened on 9 May 1988.

Replace nested (interior) parentheses with square brackets

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.

Replace nested (interior) parentheses with long dashes

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 studybees 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:

The 'Use wildcards' option

or in the Find/Replace dialog:

The 'Use wildcards' option

Tip:

  • You can add your commonly used regular expressions to the saved searches.

See also...