Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/k4m4/dash-regex
Regular expression for matching Dash addresses.
https://github.com/k4m4/dash-regex
cryptocurrency-regex dash matcher regex regex-match
Last synced: about 1 month ago
JSON representation
Regular expression for matching Dash addresses.
- Host: GitHub
- URL: https://github.com/k4m4/dash-regex
- Owner: k4m4
- License: mit
- Created: 2018-02-23T11:42:15.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-05T16:13:39.000Z (almost 2 years ago)
- Last Synced: 2024-10-12T20:43:35.173Z (2 months ago)
- Topics: cryptocurrency-regex, dash, matcher, regex, regex-match
- Language: JavaScript
- Size: 501 KB
- Stars: 4
- Watchers: 3
- Forks: 2
- Open Issues: 8
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# dash-regex [![Build Status](https://travis-ci.org/k4m4/dash-regex.svg?branch=master)](https://travis-ci.org/k4m4/dash-regex) [![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/xojs/xo)
> Regular expression for matching Dash addresses.
## Install
```
~ ❯❯❯ npm install dash-regex
```## Usage
```js
const dashRegex = require('dash-regex');dashRegex().test('nodejsrocks XbtvGzi2JgjYTbTqabUjSREWeovDxznoyh');
//=> truedashRegex({exact: true}).test('nodejsrocks XbtvGzi2JgjYTbTqabUjSREWeovDxznoyh foo');
//=> falsedashRegex({exact: true}).test('XbtvGzi2JgjYTbTqabUjSREWeovDxznoyh');
//=> true'nodejsrocks XbtvGzi2JgjYTbTqabUjSREWeovDxznoyh unicorn Xm9TJiJ7nWjme8K7iEPUGsC5JjYGzPk2QU rainbow'.match(dashRegex());
//=> ['XbtvGzi2JgjYTbTqabUjSREWeovDxznoyh', 'Xm9TJiJ7nWjme8K7iEPUGsC5JjYGzPk2QU']
```## API
### dashRegex([options])
Returns a regex for matching Dash addresses.
#### options.exact
Type: `boolean`
Default: `false` *(Matches any DASH address in a string)*Only match an exact string. Useful with `RegExp#test()` to check if a string is an DASH address.
## Related
- [ethereum-regex](https://github.com/k4m4/ethereum-regex) - Regular expression for matching Ethereum (ETH) addresses.
- [litecoin-regex](https://github.com/k4m4/litecoin-regex) - Regular expression for matching Litecoin (LTC) addresses.
- [bitcoincash-regex](https://github.com/k4m4/bitcoincash-regex) - Regular expression for matching Bitcoin Cash (BCH) addresses.
- [monero-regex](https://github.com/k4m4/monero-regex) - Regular expression for matching Monero (XMR) addresses.
- [ripple-regex](https://github.com/k4m4/ripple-regex) - Regular expression for matching Ripple (XRP) addresses.
- [neo-regex](https://github.com/k4m4/neo-regex) - Regular expression for matching NEO addresses.
- [dogecoin-regex](https://github.com/k4m4/dogecoin-regex) - Regular expression for matching Dogecoin (DOGE) addresses.## License
MIT © [Nikolaos Kamarinakis](https://nikolaskama.me)