{"id":21763608,"url":"https://github.com/josefpihrt/orang","last_synced_at":"2025-05-16T15:03:54.893Z","repository":{"id":37602938,"uuid":"230623489","full_name":"josefpihrt/orang","owner":"josefpihrt","description":"Search, replace, rename and delete directories, files and its content using the power of .NET regular expressions.","archived":false,"fork":false,"pushed_at":"2025-01-29T21:53:28.000Z","size":2224,"stargazers_count":117,"open_issues_count":18,"forks_count":9,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-03T11:11:48.066Z","etag":null,"topics":["cli","dotnet-global-tool","filesystem","regex","regexp"],"latest_commit_sha":null,"homepage":"https://josefpihrt.github.io/docs/orang","language":"C#","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/josefpihrt.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"JosefPihrt"}},"created_at":"2019-12-28T14:51:17.000Z","updated_at":"2025-03-16T12:06:50.000Z","dependencies_parsed_at":"2025-02-12T06:05:56.593Z","dependency_job_id":"d8816e66-d798-4ad6-bd98-5d0b532895bf","html_url":"https://github.com/josefpihrt/orang","commit_stats":{"total_commits":449,"total_committers":2,"mean_commits":224.5,"dds":0.00222717149220486,"last_synced_commit":"e8e0d4efa962f91ea5be51280eab6492c3932a3f"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/josefpihrt%2Forang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/josefpihrt%2Forang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/josefpihrt%2Forang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/josefpihrt%2Forang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/josefpihrt","download_url":"https://codeload.github.com/josefpihrt/orang/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248564977,"owners_count":21125412,"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":["cli","dotnet-global-tool","filesystem","regex","regexp"],"created_at":"2024-11-26T12:15:48.841Z","updated_at":"2025-04-12T11:50:36.068Z","avatar_url":"https://github.com/josefpihrt.png","language":"C#","funding_links":["https://github.com/sponsors/JosefPihrt"],"categories":[],"sub_categories":[],"readme":"# Orang \u003cimg align=\"left\" width=\"48px\" height=\"48px\" src=\"images/orang-logo-small.png\"\u003e\n\nOrang is a cross-platform command-line tool for:\n\n* [searching](https://josefpihrt.github.io/docs/orang/cli/commands/copy) files, directories and files' content,\n* [replacing](https://josefpihrt.github.io/docs/orang/cli/commands/replace) files' content,\n* [copying](https://josefpihrt.github.io/docs/orang/cli/commands/copy) files and directories,\n* [moving](https://josefpihrt.github.io/docs/orang/cli/commands/move) files and directories,\n* [renaming](https://josefpihrt.github.io/docs/orang/cli/commands/rename) files and directories,\n* [deleting](https://josefpihrt.github.io/docs/orang/cli/commands/delete) files, directories or its content,\n* [synchronizing](https://josefpihrt.github.io/docs/orang/cli/commands/sync) content of two directories,\n* [spellchecking](https://josefpihrt.github.io/docs/orang/cli/commands/spellcheck) files' content,\n* executing [Regex](https://docs.microsoft.com/cs-cz/dotnet/api/system.text.regularexpressions.regex?view=netcore-3.0) functions such as [match](https://josefpihrt.github.io/docs/orang/cli/commands/match) or [split](https://josefpihrt.github.io/docs/orang/cli/commands/split)\n\nAll these commands are powered with [.NET regular expression engine](https://docs.microsoft.com/en-us/dotnet/standard/base-types/regular-expressions).\n\n## Requirements\n\nOrang requires [.NET Core Runtime](https://dotnet.microsoft.com/download/dotnet-core/current/runtime) 3.1 or higher.\n\n## How to Install\n\nOrang is distributed as a [.NET Core global tool](https://docs.microsoft.com/en-us/dotnet/core/tools/global-tools). To install Orang run:\n\n```\ndotnet tool install -g orang.dotnet.cli\n```\n\nTo install non-alpha version run:\n\n```\ndotnet tool install -g orang.dotnet.cli --version \u003cVERSION\u003e\n```\n\nTo update Orang run:\n\n```\ndotnet tool update -g orang.dotnet.cli\n```\n\n## How to Use\n\n```\norang [command] [parameters]\n```\n\n## Basic Commands\n\n* [find](https://josefpihrt.github.io/docs/orang/cli/commands/find)\n* [replace](https://josefpihrt.github.io/docs/orang/cli/commands/replace)\n* [rename](https://josefpihrt.github.io/docs/orang/cli/commands/rename)\n* [delete](https://josefpihrt.github.io/docs/orang/cli/commands/delete)\n* [spellcheck](https://josefpihrt.github.io/docs/orang/cli/commands/spellcheck)\n\nFor a list of all commands please see [documentation](https://josefpihrt.github.io/docs/orang/cli).\n\n## How to Learn\n\nFor a full list of commands, parameters and parameter values run:\n\n```\norang help [command] [-v d]\n```\n\nFor a full manual run:\n\n```\norang help -m [-v d]\n```\n\nFor a full list of .NET regular expressions syntax run:\n\n```\norang list-patterns\n```\n\n## Features\n\n### Single match can span over multiple lines\n\nOrang supports matches across multiple lines.\n\n### Dry run\n\nThe option `-d, --dry-run` gives you opportunity to see the results before you actually replace, rename or delete anything.\n\n### Display match and replacement side-by-side\n\nThe option `-t, --highlight` with values `m[atch] r[eplacement]` gives you opportunity to see the match and the replacement side-by-side in the output.\n\n### Use C# code to compute replacements\n\nUse `-r, --replacement \u003cEXPRESSION\u003e cs[harp]` syntax to specify C# inline expression.\nThe expression is considered to be expression-body of a method with signature `string M(Match match)`\n\nUse `-r, --replacement \u003cCODE_FILE_PATH\u003e cs[harp] f[rom-file]` syntax to specify C# code file.\nThis code file must contain public method with signature `string M(Match match)`.\n\n### Load pattern from a file\n\nThe more complicated a pattern is, the less readable it becomes when written in one line.\n\n```\norang find --content \"(?x)(?\u003c=(\\A|\\.)\\s*)\\p{Ll}\\w+\\b\"\n```\n\nThe option `f[rom-file]` gives you opportunity to store pattern in a file where it can be formatted.\n\n```\norang find --content \"pattern.txt\" from-file\n```\nor\n```\norang find -c \"pattern.txt\" f\n```\n\nNote: Replacement string can be store in a file as well.\n\n### Sample Command\n\nGoal: Capitalize first character of a word at the beginning of the text or at the beginning of a sentence.\n\nFile `pattern.txt` has following content:\n\n```\n(?x)      # set multiline option\n(?\u003c=      # is preceded with\n  (\\A|\\.) # beginning of text or a dot\n  \\s*     # zero or more white-space characters\n)\n\\p{Ll}    # lowercase letter\n\\w+       # one or more word characters\n\\b        # word boundary (between word and non-word character)\n```\n\n```\norang replace ^\n --extension txt ^\n --content \"pattern.txt\" from-file ^\n --replacement \"char.ToUpper(match.Value[0]) + match.Value.Substring(1)\" csharp ^\n --highlight match replacement ^\n --display path=omit summary ^\n --dry-run\n```\nor\n```\norang replace -e txt -c \"pattern.txt\" f -r \"char.ToUpper(match.Value[0]) + match.Value.Substring(1)\" cs -t m r -y p=o su -d\n```\n\n![Capitalize first character in a sentence](/images/CapitalizeFirstCharInSentence.png)\n\n## Links\n\n* [Regular Expression Language - Quick Reference](https://docs.microsoft.com/en-us/dotnet/standard/base-types/regular-expression-language-quick-reference)\n* [.NET Regular Expressions](https://docs.microsoft.com/en-us/dotnet/standard/base-types/regular-expressions)\n* [Regular Expression Options](https://docs.microsoft.com/en-us/dotnet/standard/base-types/regular-expression-options)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjosefpihrt%2Forang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjosefpihrt%2Forang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjosefpihrt%2Forang/lists"}