{"id":19364339,"url":"https://github.com/davidfstr/renameregex","last_synced_at":"2026-05-16T19:39:35.967Z","repository":{"id":7474761,"uuid":"8822839","full_name":"davidfstr/renameregex","owner":"davidfstr","description":"Renames files in bulk using regular expressions.","archived":false,"fork":false,"pushed_at":"2016-08-31T00:39:01.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-24T03:36:39.367Z","etag":null,"topics":["regular-expression","regular-expressions","rename","rename-files","renamer","renames"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/davidfstr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-03-16T17:45:30.000Z","updated_at":"2017-12-16T21:15:20.000Z","dependencies_parsed_at":"2022-07-09T00:30:22.513Z","dependency_job_id":null,"html_url":"https://github.com/davidfstr/renameregex","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidfstr%2Frenameregex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidfstr%2Frenameregex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidfstr%2Frenameregex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidfstr%2Frenameregex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davidfstr","download_url":"https://codeload.github.com/davidfstr/renameregex/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240483765,"owners_count":19808636,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["regular-expression","regular-expressions","rename","rename-files","renamer","renames"],"created_at":"2024-11-10T07:37:10.326Z","updated_at":"2026-05-16T19:39:30.947Z","avatar_url":"https://github.com/davidfstr.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# renameregex\n\nRenames all files in the current directory using regular expression patterns.\n\nFor example `renameregex '(.*)\\.JPG' '\\1\\.jpg'` will rename all files that end with `.JPG` to end with `.jpg`.\n\nReal-world example:\n\n```\n[davidf Letters]$ renameregex '(.*?) *\\((.*)\\)(.*)' '\\2 - \\1\\3'\n\nLetter to Arlene (2010-08-18).JPG =\u003e 2010-08-18 - Letter to Arlene.JPG\nLetter to Arlene (2010-08-18).rtf =\u003e 2010-08-18 - Letter to Arlene.rtf\nLetter to Arlene (2011-03-03).jpg =\u003e 2011-03-03 - Letter to Arlene.jpg\nLetter to Arlene (2011-11-06).rtf =\u003e 2011-11-06 - Letter to Arlene.rtf\nLetter to Arlene (2012-02-23).rtf =\u003e 2012-02-23 - Letter to Arlene.rtf\nLetter to Arlene (2012-07-07).rtf =\u003e 2012-07-07 - Letter to Arlene.rtf\nLetter to Arlene (2012-11-25).rtf =\u003e 2012-11-25 - Letter to Arlene.rtf\nLetter-Photo (2011-03-03).graffle =\u003e 2011-03-03 - Letter-Photo.graffle\n\nOkay? [y/N] y\n```\n\nIt is also possible to specify `-r` to search subdirectories recursively for files to rename.\n\n## Requirements\n\n* OS X or Linux\n* Python 3.4 or later\n\n## Installation\n\n```\n$ mkdir -p ~/bin\n$ cd ~/bin\n$ git clone https://github.com/davidfstr/renameregex.git\n      # ...or download this repository to ~/bin/renameregex\n$ echo 'export PATH=\"$PATH:$HOME/bin/renameregex\"' \u003e\u003e ~/.profile\n```\n\n## Usage\n\n\u003ctt\u003e**renameregex** *filename_regex* *replacement_pattern*\u003c/tt\u003e\n\nRenames all files in the current directory that match the pattern *filename_regex* to a new name based on the *replacement_pattern*.\n\nBefore the rename is applied, a preview is printed of what files will be renamed and what they well be renamed to.\n\n### Arguments\n\n* *filename_regex* \u0026mdash; A Perl-compatible regular expression (PCRE), specifically a [Python regular expression], that is used to identify files to rename.\n\n* *replacement_pattern* \u0026mdash; A [Python regex replacement string] used to generate the new filenames. Expressions like `\\1` and `\\2` can be used to refer to groups matched by *filename_regex*.\n\n[Python regular expression]: https://docs.python.org/3.4/library/re.html#regular-expression-syntax\n\n[Python regex replacement string]: https://docs.python.org/3.4/library/re.html#re.sub\n\n## Changelog\n\n* 2.0\n    * Features:\n        * Add -r option to search directories recursively.\n    * Breaking Changes:\n        * Substitution patterns use the syntax `\\1` rather than `$1` for backreferences.\n    * Internal Changes:\n        * Rewrite script in Python rather than Java.\n* 1.0\n    * Initial version.\n\n## License\n\nThis software is licensed under the [MIT License].\n\n[MIT License]: https://github.com/davidfstr/renameregex/blob/master/LICENSE.txt","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidfstr%2Frenameregex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidfstr%2Frenameregex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidfstr%2Frenameregex/lists"}