Socket
Socket
Sign inDemoInstall

bitcoin-regex

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bitcoin-regex

Regular expression for matching Bitcoin addresses


Version published
Maintainers
1
Created
Source

bitcoin-regex Build Status

Regular expression for matching Bitcoin addresses

Install

$ npm install --save bitcoin-regex

Usage

const bitcoinRegex = require('bitcoin-regex');

bitcoinRegex().test('1dice8EMZmqKvrGE4Qc9bUFf9PX3xaYDp foo bar');
//=> true

bitcoinRegex({exact: true}).test('1dice8EMZmqKvrGE4Qc9bUFf9PX3xaYDp foo bar');
//=> false

bitcoinRegex({exact: true}).test('1dice8EMZmqKvrGE4Qc9bUFf9PX3xaYDp');
//=> true

'foo 1dice8EMZmqKvrGE4Qc9bUFf9PX3xaYDp bar 1JeTiYgfVtpA3ygQTYFswkaoiH2VnFZJf9'.match(bitcoinRegex());
//=> ['1dice8EMZmqKvrGE4Qc9bUFf9PX3xaYDp', '1JeTiYgfVtpA3ygQTYFswkaoiH2VnFZJf9']

API

bitcoinRegex([options])

Returns a regex for matching Bitcoin addresses.

options
exact

Type: boolean
Default: false (Matches any Bitcoin address in a string)

Only match an exact string. Useful with RegExp#test to check if a string is a Bitcoin address.

License

MIT © Kevin Mårtensson

Keywords

FAQs

Package last updated on 07 Sep 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc