Regular expression for matching Bitcoin addresses
Install
$ npm install --save bitcoin-regex
Usage
const bitcoinRegex = ; ;//=> true ;//=> false ;//=> true 'foo 1dice8EMZmqKvrGE4Qc9bUFf9PX3xaYDp bar 1JeTiYgfVtpA3ygQTYFswkaoiH2VnFZJf9';//=> ['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