Using the latest Directory Opus 12.18 (x64)
I spent a lot of time banging my head against the wall to determine this was a Directory Opus error (when I had assumed it was my mistake)...
When using the "Rename > Regular Expressions + Find & Replace" feature:
If you add too many grouped criteria with booleans, Directory Opus will replace the wrong section of the filename -- or -- add a number into the filename, rather than using only the text supplied as the intended replacement name.
To simplify the process of reproducing this, I will simplify the regex and provide you the threshold where it breaks. The regex string I'm pasting would not be practical normally; however, in this case it's merely a way to provide you an easier-to-read option.
Create a sample file: "Keep-ThisReplace-This.txt"
Take a regex expression like this:
(Replace|zzz)-(This)
Leave the text-replcement field blank (do the same for all subsequent tests, below)
The above works fine. Now add a bit more:
(12|34)(aaa|bbb)|(56|78)(ccc|ddd)|(Replace|zzz)-(This)
This will replace the entire filename in many cases, rather than only the "Replace-This" component. You can test any regex tool to confirm that this should not be the case.
Now add one more group:
(new|group)(added|here)|(12|34)(aaa|bbb)|(56|78)(ccc|ddd)|(Replace|zzz)-(This)
Rather than replacing the text, it will be replaced with a number which appears to be some sort of index field. In this case it would replace the text "Replace-This" with a "0" (zero).
...I've done my best to simplify this, let me know if it doesn't make sens and I'll attempt to explain in more detail.