Macro to Replace Whole Word
-
Hi, I recorded a macro using Find and Replace to remove a whole word, (the word “um”) but when I run the macro it finds all occurrences of “um” in all words. When I recorded the macro I checked “whole words only” but it didn’t change the text in the macro. I then tried using Regex \bum\b which works in the Find/Replace box. I see that using Regex caused the message=“1625” line to up to to 2 in the macro, but the macro still finds all instances, not just whole words.
Could you see what I’m doing incorrectly?
<Action type=“3” message=“1700” wParam=“0” lParam=“0” sParam=“” />
<Action type=“3” message=“1601” wParam=“0” lParam=“0” sParam=“\bum\b” />
<Action type=“3” message=“1625” wParam=“0” lParam=“2” sParam=“” />
<Action type=“3” message=“1602” wParam=“0” lParam=“0” sParam=“” />
<Action type=“3” message=“1702” wParam=“0” lParam=“768” sParam=“” />
<Action type=“3” message=“1701” wParam=“0” lParam=“1609” sParam=“” />The sample text “um” I want to replace but not the um in number.
0:09:55.380,0:09:58.980
um0:09:57.240,0:10:01.980
number 10Thanks for your help
-
@MaximillianM
does case matter? e.g., do you want to findUM
andUm
anduM
in addition toum
?In any case, it’s very strange that regex-replacing
\bum\b
doesn’t work for you. I was able to record and save a macro regex-replacing\bum\b
with nothing, and it worked find for me. -
This post is deleted! -
This post is deleted! -
@Mark-Olson Thanks for your help. I rebooted my computer and now it works.
-
@MaximillianM
Yes, my macro code is exactly the same.
BTW, please wrap code like XML in a code block like so:
``` (triple backticks)
code here
more code
```
so that it renders like thiscode here more code
-
@MaximillianM
Glad it’s working now! Very strange that you were having this problem.