Sep 20 2023 07:41 PM
Hi,
I'm trying to find extensive numbers (for example "five, ten, eleven"), and replace them with their correspondent Arabic numbers (like "5, 10, 11"). Is there a way to do that using find and replace in Word? I can't seem to find the correct regex.
Thanks in advance.
Cindi.
Sep 21 2023 11:58 PM
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:
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:
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
Sep 24 2023 09:20 AM