Bug while Saving Preset in Regex Replace Mode

Hi,

Here is a bug about presets sometimes not saving in the replace window in regex mode.
I believe it has something to do with the name of the preset.

The bug is two-fold. I was tweaking a regex search-and-replace.

  1. When it looked good, I hit "Save Preset". Then I clicked cancel from the Replace operation, as I didn't want to rename the files (I was just setting up the regex at that stage). When I went again to look at my carefully honed preset, the saved preset was not in the list!

  2. The second time around, I re-created the regex pattern /pull you hair here/ , saved the Preset, and clicked OK to replace. The replace failed because one target rename collided with an already renamed file. I went to look at the preset: Not in the list again!

To clarify, this bug is about saving presets. (Not about target collisions, regex patterns etc.)
It is pretty annoying as bugs go as I wasted time tweaking the regex (twice more than needed).

Here is everything you need to duplicate the bug.

  1. Create two files named:
    ab.1.2.txt
    ab.1.2....txt

/*
The idea of the preset is to replace every dot in a file name with a space, except:
(i) the dot before the extension
(ii) trailing dots just before the extension, which are just nuked instead of being replaced by spaces.
/*

  1. Select the files, open the replace window in regex mode.
  2. For the pattern, paste ([^.]+).(.?)(?:.).([^.]+)$#
  3. For the replace, paste \1 \2.\3
  4. Save the preset, pasting this exact name: Replace Dots w Space try ab.1.2...txt
  5. Click OK.
    The replace will fail because the second file with collide with the first.
    Open your replace window: the preset is gone.

I tried with a simpler preset name (test preset) and did not have that problem.
In case you are wondering, the long preset name ("Replace Dots w Space try ab.1.2...txt") was there to remind me of the pattern's behavior (that's why it contains the name of a test file name.)

Wishing you all a beautiful weekend

:slight_smile:

I should add that once you know about the bug, it's not a big deal, as you can work around it by

  1. saving your regex patterns to a text file just in case, and
  2. giving "simple names" to your presets.

(At this stage, I am not sure what constitutes an unacceptable name for a preset, but finding an acceptable name is easy.)

I can duplicate this.

FYI: You can get your last rename dialog settings back by clicking the Last Rename preset.

Hi MrC,

You're right about the Last Rename. I tried that and see that even though the Preset had vanished, I didn't have to reconstruct the regex.

Just tried again saving a regex with dots in it. Same story, it "pretends" to save it, but when you come back to it later, the "saved preset" has vanished.
So that is a small bug for our mighty developers.