{"id":21840216,"url":"https://github.com/gocom/rah_replace","last_synced_at":"2025-10-06T17:31:57.312Z","repository":{"id":2357073,"uuid":"3320376","full_name":"gocom/rah_replace","owner":"gocom","description":"Search and replace for Textpattern CMS","archived":false,"fork":false,"pushed_at":"2022-04-17T14:58:51.000Z","size":32,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-26T11:08:25.140Z","etag":null,"topics":["php","textpattern","textpattern-plugin"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gocom.png","metadata":{"files":{"readme":"README.textile","changelog":null,"contributing":"CONTRIBUTING.textile","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"custom":["https://www.paypal.me/jukkasvahn"]}},"created_at":"2012-02-01T00:18:45.000Z","updated_at":"2022-04-17T14:57:03.000Z","dependencies_parsed_at":"2022-09-22T14:26:17.910Z","dependency_job_id":null,"html_url":"https://github.com/gocom/rah_replace","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gocom%2Frah_replace","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gocom%2Frah_replace/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gocom%2Frah_replace/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gocom%2Frah_replace/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gocom","download_url":"https://codeload.github.com/gocom/rah_replace/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244822878,"owners_count":20516182,"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":["php","textpattern","textpattern-plugin"],"created_at":"2024-11-27T21:25:12.586Z","updated_at":"2025-10-06T17:31:52.263Z","avatar_url":"https://github.com/gocom.png","language":"PHP","funding_links":["https://www.paypal.me/jukkasvahn"],"categories":[],"sub_categories":[],"readme":"h1. rah_replace\n\n\"Download\":https://github.com/gocom/rah_replace/releases | \"Packagist\":https://packagist.org/packages/rah/rah_replace | \"Issues\":https://github.com/gocom/rah_replace/issues\n\n\"Textpattern CMS\":https://textpattern.com template tag that returns contained content with all searched occurrences replaced with given replacements, in the same manner as PHP's \"str_replace\":https://secure.php.net/manual/en/function.str-replace.php function.\n\nh2. Install\n\nUsing \"Composer\":https://getcomposer.org:\n\nbc. $ composer require rah/rah_replace\n\nOr \"download\":https://github.com/gocom/rah_replace/releases an installer package.\n\nh2. Basics\n\nThe plugin, rah_replace, introduces a new container tag to Textpattern's arsenal. The tag returns wrapped content with all found occurrences replaced with given replacements. A tag supports multiple searched occurrences and replacements.\n\nbc. \u003crah::replace from=\"value1, value2, ...\" to=\"value1, value2, ...\"\u003e\n    Searched content\n\u003c/rah::replace\u003e\n\nh2. Attributes\n\nbc. \u003crah::replace\u003e\n    ...contained statement...\n\u003c/rah::replace\u003e\n\nThe tag is a container and attributes for it follow.\n\n*from*\nStrings that will be searched and replaced with @to@ attribute's values. Separate multiple values with a comma (or @delimiter@ if changed).\nDefault: @from=\"\"@ Example: @\"dog,cat,house\"@\n\n*to*\nReplacements that will be used to replace @from@ attribute's values. Comma (or @delimiter@) separated if multiple.\nDefault: @to=\"\"@ Example: @\"ship,home,hat\"@\n\n*delimiter*\nSets the delimiter used in @from@ and @to@ to separate multiple values. Default is a comma.\nDefault: @delimiter=\",\"@ Example: @\"|\"@\n\nh2. Examples\n\nh3. Replaces a _dog_ with a _cat_\n\nbc. \u003crah::replace from=\"dog\" to=\"cat\"\u003e\n    My favorite animal is a dog.\n\u003c/rah::replace\u003e\n\nReturns: @My favorite animal is a cat.@\n\nh3. Replace multiple needles with different replacements\n\nbc. \u003crah::replace from=\"house,dog,Mike\" to=\"boat,friend,wife\"\u003e\n    I live in a house with my dog and Mike.\n\u003c/rah::replace\u003e\n\nReturns: @I live in a boat with my friend and wife.@\n\nh3. Replace multiple needles with a one replacement\n\nbc. \u003crah::replace from=\"Mike,dad\" to=\"I\"\u003e\n    I remember when dad and Mike did go to fishing.\n\u003c/rah::replace\u003e\n\nReturns: @I remember when I and I did go to fishing.@\n\nh3. Using a different delimiter\n\np. By default any comma is treated as a delimiter and can not be used as actual value. To use a comma (@,@) as a needle or a replacement, you would have to change the delimiter to something else. Like for instance to a vertical bar:\n\nbc. \u003crah::replace from=\".|,\" to=\"!\" delimiter=\"|\"\u003e\n    A, B, C.\n\u003c/rah::replace\u003e\n\nReturns: @A! B! C!@\n\nh2. Changelog\n\nh3. Version 0.5.0 - 2019/04/06\n\n* Register the tag for Textpattern \u003e= 4.7.0 compatibility.\n* Now requires Textpattern \u003e= 4.7.0.\n\nh3. Version 0.4.2 - 2013/05/07\n\n* The Composer package uses \"textpattern/installer\":https://packagist.org/packages/textpattern/installer and \"textpattern/lock\":https://packagist.org/packages/textpattern/installer.\n\nh3. Version 0.4.1 - 2013/04/25\n\n* Minor clean up.\n* Released as a \"Composer package\":https://packagist.org/packages/rah/rah_replace.\n\nh3. Version 0.4 - 2012/07/12\n\n* Performance optimization.\n\nh3. Version 0.3 - 2011/04/22\n\n* Performance optimization.\n\nh3. Version 0.2 - 2009/04/16\n\n* Added a new attribute: @delimiter@.\n\nh3. Version 0.1 - 2009/04/16\n\n* Initial release.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgocom%2Frah_replace","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgocom%2Frah_replace","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgocom%2Frah_replace/lists"}