C rer - regex file renamer

I've created a tool that renames files using regular expressions. It can be invoked like this: rer /pattern/replacement/modifiers file [file [...]]. Each file is matched against a pattern; if a match is found the file is renamed.

Examples:
  • Rename all IMG* files to picture* (e.g. IMG_1000.jpg to picture_1000.jpg): rer /IMG/picture/ IMG*
  • Swap first word with second (renaming foo-bar to bar-foo, foo-123 to 123-foo): rer '/(\w+)-(\w+)/\2-\1/' foo-bar foo-123
It runs fine on my FreeBSD system, but it's in a very early stage and probably will not compile on Linux. devel/bmake is used to build the project, but I have not found any documentation on how to write bmake Makefiles, so it's probably a little bit of a mess.

I've pushed the code to GitHub: https://github.com/serpent7776/rer

I hope it will be usable for someone.
 
Last edited by a moderator:
Back
Top