dogecoin-regex
TypeScript icon, indicating that this package has built-in type declarations

1.0.10 • Public • Published

dogecoin-regex Build Status XO code style

Regular expression for matching Dogecoin (DOGE) addresses.

Install

~ ❯❯❯ npm install dogecoin-regex

Usage

const dogecoinRegex = require('dogecoin-regex');
 
dogecoinRegex().test('nodejsrocks DANHz6EQVoWyZ9rER56DwTXHWUxfkv9k2o');
//=> true
 
dogecoinRegex({exact: true}).test('nodejsrocks DANHz6EQVoWyZ9rER56DwTXHWUxfkv9k2o foo');
//=> false
 
dogecoinRegex({exact: true}).test('DANHz6EQVoWyZ9rER56DwTXHWUxfkv9k2o');
//=> true
 
'nodejsrocks DANHz6EQVoWyZ9rER56DwTXHWUxfkv9k2o unicorn DDTtqnuZ5kfRT5qh2c7sNtqrJmV3iXYdGG rainbow'.match(dogecoinRegex());
//=> ['DANHz6EQVoWyZ9rER56DwTXHWUxfkv9k2o', 'DDTtqnuZ5kfRT5qh2c7sNtqrJmV3iXYdGG']

API

dogecoinRegex([options])

Returns a regex for matching Dogecoin (DOGE) addresses.

options.exact

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

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

Related

  • ethereum-regex - Regular expression for matching Ethereum (ETH) addresses.
  • litecoin-regex - Regular expression for matching Litecoin (LTC) addresses.
  • bitcoincash-regex - Regular expression for matching Bitcoin Cash (BCH) addresses.
  • monero-regex - Regular expression for matching Monero (XMR) addresses.
  • dash-regex - Regular expression for matching Dash addresses.
  • ripple-regex - Regular expression for matching Ripple (XRP) addresses.
  • neo-regex - Regular expression for matching NEO addresses.

License

MIT © Nikolaos Kamarinakis

Readme

Keywords

Package Sidebar

Install

npm i dogecoin-regex

Weekly Downloads

103

Version

1.0.10

License

MIT

Unpacked Size

4.68 kB

Total Files

5

Last publish

Collaborators

  • k4m4