{"id":19933958,"url":"https://github.com/k4m4/bitcoincash-regex","last_synced_at":"2025-06-12T07:04:58.632Z","repository":{"id":29729894,"uuid":"122614492","full_name":"k4m4/bitcoincash-regex","owner":"k4m4","description":"Regular expression for matching Bitcoin Cash (BCH) Legacy and CashAddr addresses.","archived":false,"fork":false,"pushed_at":"2023-01-05T16:13:40.000Z","size":553,"stargazers_count":8,"open_issues_count":7,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-25T17:48:55.842Z","etag":null,"topics":["bch","bitcoin-cash","cryptocurrency-regex","matcher","regex","regex-match"],"latest_commit_sha":null,"homepage":"","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/k4m4.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-23T11:45:36.000Z","updated_at":"2023-06-23T16:16:00.000Z","dependencies_parsed_at":"2023-01-14T15:45:20.193Z","dependency_job_id":null,"html_url":"https://github.com/k4m4/bitcoincash-regex","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/k4m4%2Fbitcoincash-regex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k4m4%2Fbitcoincash-regex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k4m4%2Fbitcoincash-regex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k4m4%2Fbitcoincash-regex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/k4m4","download_url":"https://codeload.github.com/k4m4/bitcoincash-regex/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252190433,"owners_count":21708880,"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":["bch","bitcoin-cash","cryptocurrency-regex","matcher","regex","regex-match"],"created_at":"2024-11-12T23:15:26.143Z","updated_at":"2025-05-03T12:30:23.929Z","avatar_url":"https://github.com/k4m4.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bitcoincash-regex [![Build Status](https://travis-ci.org/k4m4/bitcoincash-regex.svg?branch=master)](https://travis-ci.org/k4m4/bitcoincash-regex) [![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/xojs/xo)\n\n\u003e Regular expression for matching Bitcoin Cash (BCH) Legacy and CashAddr addresses.\n\n\n## Install\n\n```\n~ ❯❯❯ npm install bitcoincash-regex\n```\n\n\n## Usage\n\n```js\nconst bchRegex = require('bitcoincash-regex')\n\nbchRegex().test('nodejsrocks 19hZx234vNtLazfx5J2bxHsiWEmeYE8a7k')\n//=\u003e true\n\nbchRegex({exact: true}).test('nodejsrocks 19hZx234vNtLazfx5J2bxHsiWEmeYE8a7k foo')\n//=\u003e false\n\nbchRegex({exact: true}).test('19hZx234vNtLazfx5J2bxHsiWEmeYE8a7k')\n//=\u003e true\n\nbchRegex.format('cashaddr', {exact: true}).test('bitcoincash:qpm2qsznhks23z7629mms6s4cwef74vcwvy22gdx6a')\n//=\u003e true\n\nbchRegex.format('cashaddr', {exact: true}).test('19hZx234vNtLazfx5J2bxHsiWEmeYE8a7k')\n//=\u003e false\n\n'nodejsrocks 19hZx234vNtLazfx5J2bxHsiWEmeYE8a7k unicorn bitcoincash:qpm2qsznhks23z7629mms6s4cwef74vcwvy22gdx6a rainbow'.match(bchRegex());\n//=\u003e ['19hZx234vNtLazfx5J2bxHsiWEmeYE8a7k', 'bitcoincash:qpm2qsznhks23z7629mms6s4cwef74vcwvy22gdx6a']\n```\n\n\n## API\n\n### bchRegex([options])\n\nReturns a regex for matching BCH addresses.\n\n#### options.exact\n\nType: `boolean`\u003cbr\u003e\nDefault: `false` *(Matches any BCH address in a string)*\n\nOnly match an exact string. Useful with `RegExp#test()` to check if a string is an BCH address.\n\n\n### bchRegex.format([format], [options])\n\nReturns a regex for matching specific BCH format addresses.\n\n#### format\n\nType: `string`\u003cbr\u003e\nSupported Formats: `legacy`, `cashaddr`\n\nMatch a specific BCH address format.\n\n#### options.exact\n\nType: `boolean`\u003cbr\u003e\nDefault: `false` *(Matches any BCH address in a string)*\n\nOnly match an exact string. Useful with `RegExp#test()` to check if a string is an BCH address.\n\n\n## Related\n\n- [ethereum-regex](https://github.com/k4m4/ethereum-regex) - Regular expression for matching Ethereum (ETH) addresses.\n- [litecoin-regex](https://github.com/k4m4/litecoin-regex) - Regular expression for matching Litecoin (LTC) addresses.\n- [monero-regex](https://github.com/k4m4/monero-regex) - Regular expression for matching Monero (XMR) addresses.\n- [dash-regex](https://github.com/k4m4/dash-regex) - Regular expression for matching Dash addresses.\n- [ripple-regex](https://github.com/k4m4/ripple-regex) - Regular expression for matching Ripple (XRP) addresses.\n- [neo-regex](https://github.com/k4m4/neo-regex) - Regular expression for matching NEO addresses.\n- [dogecoin-regex](https://github.com/k4m4/dogecoin-regex) - Regular expression for matching Dogecoin (DOGE) addresses.\n\n\n## License\n\nMIT © [Nikolaos Kamarinakis](https://nikolaskama.me)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fk4m4%2Fbitcoincash-regex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fk4m4%2Fbitcoincash-regex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fk4m4%2Fbitcoincash-regex/lists"}