{"id":20996146,"url":"https://github.com/linhuiw/react-deep-match","last_synced_at":"2025-06-18T02:33:18.523Z","repository":{"id":41284390,"uuid":"101845884","full_name":"linhuiw/react-deep-match","owner":"linhuiw","description":"🔍 A deep regex match component for react, support ReactNode match.","archived":false,"fork":false,"pushed_at":"2022-06-30T08:52:48.000Z","size":899,"stargazers_count":17,"open_issues_count":0,"forks_count":3,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-05-30T06:07:47.892Z","etag":null,"topics":["component","find","regex","regex-match"],"latest_commit_sha":null,"homepage":"https://linhuiw.github.io/react-deep-match","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/linhuiw.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-30T06:29:26.000Z","updated_at":"2025-02-23T14:33:28.000Z","dependencies_parsed_at":"2022-07-06T16:04:21.761Z","dependency_job_id":null,"html_url":"https://github.com/linhuiw/react-deep-match","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/linhuiw/react-deep-match","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linhuiw%2Freact-deep-match","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linhuiw%2Freact-deep-match/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linhuiw%2Freact-deep-match/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linhuiw%2Freact-deep-match/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/linhuiw","download_url":"https://codeload.github.com/linhuiw/react-deep-match/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linhuiw%2Freact-deep-match/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259756665,"owners_count":22906664,"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":["component","find","regex","regex-match"],"created_at":"2024-11-19T07:28:15.065Z","updated_at":"2025-06-18T02:33:13.508Z","avatar_url":"https://github.com/linhuiw.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React-deep-match\n\n🔍  A deep regex match component for React, support ReactNode match.\n\nReact-deep-match support regular expression matches in a ReactDom or a string; and wrap each match a react node, also support custom wrap;\n\n[See the demo](https://linhuiw.github.io/react-deep-match/)\n\n\n## How To Use\n\nFor example:\n\n```javascript\nimport DeepMatch from 'react-deep-match';\n\n\u003cDeepMatch text='testvalue' find=\"test\" /\u003e\n// result:\n\u003cdiv\u003e\u003cspan class=\"matched\"\u003etest\u003c/span\u003evalue\u003c/div\u003e\n```\nAlso component support reactNode deep Match\n\n```javascript\n\u003cDeepMatch\ntext={\u003cp\u003e\n  \u003cdiv\u003etestvalue\u003c/div\u003e\n  \u003cspan\u003evaluetest2\u003c/span\u003e\n\u003c/p\u003e}\nfind=\"test\"\n/\u003e\n// result:\n\u003cdiv\u003e\n  \u003cp\u003e\n    \u003cdiv\u003e\u003cspan class=\"matched\"\u003etest\u003c/span\u003evalue\u003c/div\u003e\n    \u003cspan\u003evalue\u003cspan class=\"matched\"\u003etest\u003c/span\u003e2\u003c/span\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n```\nAnd component support Regex match, and custom match wrap;\n```javascript\n\u003cDeepMatch\n  text={\u003cp\u003e\n    \u003cspan\u003etestvalue123test\u003c/span\u003e\n  \u003c/p\u003e}\n  find={/[0-9]/g}\n  wrap={(matched) =\u003e {\n    return \u003ci class=\"number\"\u003e{matched}\u003c/i\u003e;\n  }}\n/\u003e\n// result:\n\u003cdiv\u003e\u003cp\u003e\n  \u003cspan\u003etestvalue\u003ci class=\"number\"\u003e{123}\u003c/i\u003etest\u003c/span\u003e\n\u003c/p\u003e\u003c/div\u003e\n```\n## Installation\n```javascript\nnpm install react-deep-match --save\n\nimport DeepMatch from 'react-deep-match';\n```\n\n## API\nreact-deep-match supports these props;\n\n- text(string | ReactNode): Text or ReactNode, you want to search for\n- find(string | RegExp): Text or a RegExp, the rules you want to match text\n- wrap((match: string, index: string) =\u003e string | React.ReactNode): A Function, you want to wrap your matched texts, argument is the matched text\n\n## Related\n\n[padolsey/findAndReplaceDOMText](https://github.com/padolsey/findAndReplaceDOMText) - 🔍 Find and replace DOM text\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinhuiw%2Freact-deep-match","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinhuiw%2Freact-deep-match","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinhuiw%2Freact-deep-match/lists"}