Document Editing Problems

Replace Parentheses Around Wildcard References in Microsoft Word

Muhammad TalhaMuhammad Talha Nov 14, 2026 868 views

Question details

Replace parentheses around references such as (p456) with square brackets while preserving the reference text.

Replace Parentheses Around Wildcard References in Microsoft Word
Product
Microsoft Word
Device & OS
not provided
Scenario
The user wants to change reference punctuation using Word's wildcard Find and Replace feature.
Observed behavior
References such as (p456) should become [p456], with the letter and digits unchanged.
Before you start

Check whether the references contain exactly three digits or a variable number of digits. Open the document in Word and identify a few examples to test the pattern.

Solution 1Recommended

Use Word wildcards to replace parentheses with square brackets

Use this method to preserve each reference while changing its surrounding punctuation.

The backslashes make Word treat the outer parentheses as literal characters. The inner parentheses capture the reference text, which the replacement inserts using \1.

1
Open Find and Replace

In Word, open Home > Replace, or press Ctrl+H where supported.

2
Enable wildcards

Select More if needed, then check Use wildcards.

3
Enter the search pattern

In Find what, enter \((p[0-9]{3})\) for references with exactly three digits. For one or more digits, enter \((p[0-9]@)\) instead.

4
Enter the replacement

In Replace with, enter [\1]. This keeps the captured reference and surrounds it with square brackets.

5
Test and replace

Select Find Next and Replace to check a match, then use Replace All if the results are correct.

Use Word wildcards to replace parentheses with square brackets
Check the reference format: These patterns match a lowercase p immediately followed by digits, with no spaces inside the parentheses.
Free Microsoft Office alternative

Edit Word documents and references with WPS Writer

WPS Office is a free, lightweight alternative for editing documents in a familiar interface. Open compatible Word files to continue working with minimal disruption; use Microsoft Word for the wildcard syntax described above.

Edit document references and punctuation in WPS WriterOpen and save Microsoft Word DOC and DOCX filesUse a familiar interface for an easier transition from OfficeWork with a lightweight, free office suite
microsoft office alternative - wps office

Frequently Asked Questions

How do I match references with any number of digits?

With Use wildcards checked in Word's Replace dialog, enter \((p[0-9]@)\) in Find what. The @ matches one or more digits.

What does \1 mean in the replacement?

In Replace with, \1 inserts the text captured by the first group of parentheses in the wildcard pattern. Enter [\1] to put square brackets around that text.

Why are the outer parentheses preceded by backslashes?

In Word wildcard searches, parentheses normally mark a group. The backslashes in \( and \) make Word search for literal parentheses around the reference.

Will the three-digit pattern match (p4567)?

No. The pattern \((p[0-9]{3})\) requires exactly three digits between p and the closing parenthesis. Use \((p[0-9]@)\) for one or more digits.