{"id":21148881,"url":"https://github.com/samliebl/regex-map-replace","last_synced_at":"2025-03-14T14:14:07.970Z","repository":{"id":57156137,"uuid":"212762863","full_name":"samliebl/regex-map-replace","owner":"samliebl","description":"Run a text string through an array of individual match-replace regular expressions.","archived":false,"fork":false,"pushed_at":"2020-03-24T13:49:21.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-05-08T12:35:50.008Z","etag":null,"topics":["map","match","regex","regexp","regular-expression","replace","replace-text","string-formatter"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/samliebl.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":"2019-10-04T07:50:07.000Z","updated_at":"2023-04-22T17:03:50.000Z","dependencies_parsed_at":"2022-08-28T18:43:50.016Z","dependency_job_id":null,"html_url":"https://github.com/samliebl/regex-map-replace","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samliebl%2Fregex-map-replace","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samliebl%2Fregex-map-replace/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samliebl%2Fregex-map-replace/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samliebl%2Fregex-map-replace/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samliebl","download_url":"https://codeload.github.com/samliebl/regex-map-replace/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243589333,"owners_count":20315471,"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":["map","match","regex","regexp","regular-expression","replace","replace-text","string-formatter"],"created_at":"2024-11-20T09:29:39.213Z","updated_at":"2025-03-14T14:14:07.923Z","avatar_url":"https://github.com/samliebl.png","language":"JavaScript","readme":"# regex-map-replace #\n\nRun a text string through an array of individual match-replace regular expressions.\n\n## Overview ##\n\nThis is a simple npm module built to clean up text strings. It’s a single function that takes two parameters: `str` and `map`. `str` is a string of text. `map` is an array of objects, each with two properties: `match` and `replace`. These two properties are a dictionary, with `match` being the actual regular expression for your desired matching substring; `replace` being a string you want to replace it with.\n\n## Installation ##\n\n```sh\n$ npm install regex-map-replace\n```\n\n## Example ##\n\n```js\nvar regexMapReplace = require('regex-map-replace');\n\nvar map = [{\n    match: /Lorum/,\n    replace: 'Lorem'\n},{\n    match: /doler/,\n    replace: 'dolor'\n},{\n    match: /amit/,\n    replace: 'amet'\n}];\n\nvar test = regexMapReplace('Lorum ipsum doler sit amit.', map);\n\nconsole.log(test);\n// Expected result: 'Lorem ipsum dolor sit amet.'\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamliebl%2Fregex-map-replace","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamliebl%2Fregex-map-replace","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamliebl%2Fregex-map-replace/lists"}