# bitcoin-regex

> Regular expression for matching Bitcoin addresses

Latest version **2.0.0** (published 2016-09-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install bitcoin-regex
pnpm add bitcoin-regex
yarn add bitcoin-regex
bun add bitcoin-regex
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2016-09-07 |
| First published | 2014-11-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 21 |
| Author | Kevin Mårtensson |
| Maintainers | kevva |
| Keywords | address, bitcoin, regex, string |

## Links

- npm: https://www.npmjs.com/package/bitcoin-regex
- Repository: https://github.com/kevva/bitcoin-regex
- Homepage: https://github.com/kevva/bitcoin-regex#readme
- Issues: https://github.com/kevva/bitcoin-regex/issues
- npm.io page: https://npm.io/package/bitcoin-regex

## Alternatives

- [@mce/gif](https://npm.io/package/@mce/gif.md) — 2.6K weekly downloads
- [cleanse](https://npm.io/package/cleanse.md) — 173 weekly downloads
- [str](https://npm.io/package/str.md) — 127 weekly downloads
- [naming](https://npm.io/package/naming.md) — 95 weekly downloads
- [tap-telco-api](https://npm.io/package/tap-telco-api.md) — 19 weekly downloads

## Recent versions

- 2.0.0 (latest) — 2016-09-07
- 1.1.0 — 2014-11-27
- 1.0.2 — 2014-11-21
- 1.0.1 — 2014-11-21
- 1.0.0 — 2014-11-21

## README

# bitcoin-regex [![Build Status](https://travis-ci.org/kevva/bitcoin-regex.svg?branch=master)](https://travis-ci.org/kevva/bitcoin-regex)

> Regular expression for matching Bitcoin addresses


## Install

```
$ npm install --save bitcoin-regex
```


## Usage

```js
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`<br>
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](https://github.com/kevva)

---
_Source: https://npm.io/package/bitcoin-regex · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
