1.1.8 • Published 4 years ago

ripple-regex v1.1.8

Weekly downloads
32
License
MIT
Repository
github
Last release
4 years ago

ripple-regex Build Status XO code style

Regular expression for matching Ripple (XRP) addresses

Install

~ ❯❯❯ npm install ripple-regex

Usage

const rippleRegex = require('ripple-regex');

rippleRegex().test('nodejsrocks rG2ZJRab3EGBmpoxUyiF2guB3GoQTwMGEC');
//=> true

rippleRegex({exact: true}).test('nodejsrocks rG2ZJRab3EGBmpoxUyiF2guB3GoQTwMGEC foo');
//=> false

rippleRegex({exact: true}).test('rG2ZJRab3EGBmpoxUyiF2guB3GoQTwMGEC');
//=> true

'nodejsrocks rG2ZJRab3EGBmpoxUyiF2guB3GoQTwMGEC unicorn rfBKzgkPt9EvSJmk1uhoWTauaFCaRh4jMp rainbow'.match(rippleRegex());
//=> ['rG2ZJRab3EGBmpoxUyiF2guB3GoQTwMGEC', 'rfBKzgkPt9EvSJmk1uhoWTauaFCaRh4jMp']

API

rippleRegex(options)

Returns a regex for matching XRP addresses.

options.exact

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

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

Related

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

License

MIT © Nikolaos Kamarinakis