How to Find and Replace Multi-Digit Numbers in Word with Wildcards
Question details
The user needs to locate and replace complete multi-digit numbers (such as 10 or 100) as single entities rather than modifying individual digits.

- Product
- Word
- Device & OS
- not provided
- Scenario
- Editing a document that contains numerical values requiring bulk formatting, extraction, or addition of surrounding text.
- Observed behavior
- Using the standard '^#' code in Word only matches single digits, causing multi-digit numbers to be split and treated as separate, individual matches.
Open your Word document and press Ctrl+H to access the Find and Replace dialog box, then click the 'More' button to reveal advanced search options.
Use Wildcard Expressions to Capture Complete Numbers
Enable the wildcard feature to group digits into complete numbers using bracketed expressions, allowing you to reuse the exact matched number in your replacement.
By default, Word treats each digit as a standalone character. By utilizing wildcard patterns, you can define ranges and repetitions to capture an entire string of digits as a single word.
Wrapping your search query in parentheses allows you to capture the found number. You can then insert that exact number into your replacement text using a backreference.
Press the keyboard shortcut Ctrl+H to open the 'Find and Replace' dialog box.
Click the 'More' button in the bottom-left corner to expand advanced options, and check the box labeled 'Use wildcards'.
In the 'Find what' field, type (\<[0-9]{1,}\>) to capture complete numbers of any length. The parentheses capture the group, and the brackets define the digit range.
In the 'Replace with' field, type your new text and use \1 to represent the original number. For example, typing [New Text \1 New Text] will keep the number and add text around it.
Click 'Find Next' to verify the match is correct, or click 'Replace All' to process the entire document.
Easily Find and Replace Complex Text with WPS Writer
WPS Writer offers a powerful Find and Replace tool with full wildcard support, allowing you to edit numbers, regex patterns, and complex text structures seamlessly.
- 1. Open WPS Writer: Launch WPS Office and open your text document.
- 2. Access Find and Replace: Press 'Ctrl+H' to bring up the Find and Replace window.
- 3. Enable Advanced Search: Click the 'Options' button in the dialog and tick the 'Use wildcards' checkbox.
- 4. Execute Replacement: Input your wildcard query, such as \<[0-9]@\>, set your replacement text, and click 'Replace All'.

Frequently Asked Questions
How do I limit the wildcard search to exactly two-digit numbers?
In the 'Find what' box, use the expression \<[0-9]{2}\>. This specifies that exactly two digits must appear together as an independent word, ignoring single digits or numbers with three or more digits.
Why isn't my wildcard search finding any numbers?
Ensure that the 'Use wildcards' checkbox is ticked in the Find and Replace expanded options. Wildcard syntax will fail to match if this setting is disabled, because the application will search for the literal brackets and numbers you typed instead of treating them as an expression.
What does \1 mean in the replacement text box?
The \1 syntax is a backreference. It represents the first 'captured' group from your search criteria (everything enclosed inside the first set of parentheses). It tells the software to output the exact text or number it just found, enabling you to add new text around the original number without deleting it.




