Forum Discussion
MS Word: Find&Replace back reference is messed up
I am having a problem with this for some time, and couldn't find out anything about it yet
Any help would be appreciated:
Details:
Windows: 10
MS Word Version: MS Office Home & Student 2021
Context:
Trying to fix hundred of missing spaces after ":" at once.
E.g.: deviation:Mandatory BUN
Procedure:
Find: (?:)(?) ==> please note it could be "[A-Z|a-z]" instead of "?"
Replace by: \1 \2
Expected result:
deviatio[n: M]andatory BUN
Actual result:
deviatio[n:M ]andatory BUN
The only information on this I found so far was this topic: https://superuser.com/questions/1165168/why-are-ms-word-regex-backreference-replacements-out-of-order
Thank you very much in advance for any help provided!
Wish you a great week ahead.
0_Hichiko_0 Just use an ordinary (non wildcard) replace and put a colon in the Find what control and a colon followed by a space in the Replace with control
If you aready have some colons followed by a space and don't want two spaces after a colon, them do another Find and Replace with a colon followed by two spaces in the Find what control and the colon followed by one space in the Replace with control.
- 0_Hichiko_0Copper Contributor
Hi Doug,
I hope this finds you well. 😄
I ended up doing something like you suggested.
However, the issue persists in other examples as well. I need to use regex on a daily basis and this bug is really precluding me from working with MS Word, my favorite tool.
Is there a way to properly report this?
Best,
Hichiko
0_Hichiko_0 Why do you want to use Regex? I never use it and when necessary, use a Wildcard replace.
Give us some examples that do not work for you.