Replace file extension

A swapping-ground for Regular Expression syntax

Replace file extension

Postby cmatrix » Sat Apr 20, 2024 6:52 pm

I want to replace the extension of all files with a different extension. So file_1.doc and file_2.xls become file_1.pdf and file_2.pdf. It should work with any extension.

I tried using section RegEx (1) with ^(.*)$ in the Match and pdf in the Replace but this replaces the front part not the extension.

What is the correct way to do this?
cmatrix
 
Posts: 1
Joined: Sat Apr 20, 2024 6:47 pm

Change all file extensions to .pdf

Postby Luuk » Sat Apr 20, 2024 11:22 pm

With Extensions(11) can just choose "Fixed" with a string like pdf

All other-settings need a checkmark for "Renaming Options, File/Folder Extensions, Rename File Extensions".
So if wanting to use that checkmark, RegEx(1) could then use a "Match" and "Replace" like...
(.+\.)[^.]+$
\1pdf
Luuk
 
Posts: 709
Joined: Fri Feb 21, 2020 10:58 pm


Return to Regular Expressions


cron