Can this be done in regex?

I am trying to get a regex setup to rename files that look something like this example:

This.is.a.file.on.a.computer.1.24.05.zip

I want to strip the dots that occur only in the alpha portion so that file gets renamed to this:

This is a file on a computer 1.24.05.zip

Can this be done using regex and if so could you please provide an example? Been through help file and the other thread here but I'm not getting anywhere! :confused:

I just need help with the from and to, the rest I can actually handle!

Thank you for any thoughts.

You seem to get errors if you try to combine both steps onto one button, but you can achieve what you want with a pair of buttons.

If you put one on the LMB and the other on the RMB action of a 3-button you can rename as many of these files as you like with just two clicks.

LMB (convert all dots to spaces):

[DOpus.ButtonInfo] Name=Dots to Spaces Icon=16,9999999 Flags=2,0,0 Color=0,a0a0a0 Func1=rename PATTERN="." TO=" " FINDREP Func2=@nodeselect
RMB (convert at most two spaces with numbers on both sites into spaces):

[DOpus.ButtonInfo] Name=Number Spaces to Dots Icon=16,9999999 Flags=2,0,0 Color=0,a0a0a0 Func1=rename PATTERN="(.*[0-9]) ([0-9].*)" TO="\1.\2" REGEXP Func2=rename PATTERN="(.*[0-9]) ([0-9].*)" TO="\1.\2" REGEXP Func3=@nodeselect
That seems to work, but this kind of thing approaches the limits of what you can do with basic regexp renaming. If we had recursive-regexp renaming (i.e. where Opus kept applying the rename pattern until it no longer matched, instead of only applying it once) then you could do this in a single line, single click.

Building on Nudel's idea here's a way you can do it all with one button click. Note that for this to work the file names must end in one or more digits followed by a period followed by one or more digits followed by another period followed by one or more digits then finally the file extension.

In other words, like the files in your example.

John

[DOpus.ButtonInfo]
Name=Strip periods
Icon=84,9999999
Flags=2,0,0
Color=0,a0a0a0
Tooltip=Strips periods between alphabet characters only
Func1=rename PATTERN="." TO=" " FINDREP
Func2=@nodeselect
Func3=rename PATTERN="(.[0-9]+) ([0-9]+) ([0-9]+..)" TO="\1.\2.\3" REGEXP

Oh yeah, why didn't I think of that? :slight_smile: hehe

I was using one more reg-exp rename than I needed to, and using a F&R followed by more than one RegExp rename in the same button seemed to cause error messages.

This has helped me a lot. I am motivated to learn more regex, this real world example sure did shed some light for me. Thanks you guys! :smiley: