Forum Discussion
Find and replace extensive numbers.
Hi cindix,
To find and replace extensive numbers in Word using Find and Replace, you can use the following regular expression:
\b(\w+)(-|\s)(and|to)\s(\w+)\b
This regex will match any word followed by a hyphen, space, or the words "and" or "to" followed by another word. It will also ignore any leading or trailing spaces.
To use this regex, follow these steps:
- Press Ctrl+H to open the Find and Replace dialog box.
- In the Find what box, type the regex \b(\w+)(-|\s)(and|to)\s(\w+)\b.
- In the Replace with box, type the Arabic number equivalent of the extensive number.
- Click Replace All to replace all instances of the extensive number in your document.
Here is an example of how to use the regex to replace the extensive number "five, ten, eleven" with the Arabic numbers "5, 10, 11":
Find what: \b(\w+)(-|\s)(and|to)\s(\w+)\b
Replace with: $1$2$3$4
This will replace the extensive number "five, ten, eleven" with the string "5, 10, 11".
Here are some links a a reference:
- https://support.microsoft.com/en-gb/office/find-and-replace-text-c6728c16-469e-43cd-afe4-7708c6c779b7
- https://www.techrepublic.com/article/10-cool-ways-to-get-more-from-words-find-and-replace-feature/
- https://stackoverflow.com/questions/24308538/find-and-replace-with-regex-in-microsoft-word-2013
Please click Mark as Best Response & Like if my post helped you to solve your issue.
This will help others to find the correct solution easily. It also closes the item.
If the post was useful in other ways, please consider giving it Like.
Kindest regards,
Leon Pavesic
- cindixSep 24, 2023Copper ContributorNope. That gave me no results even though I have a text full of extensive numbers.
Maybe I should use a conversion VBA function?