Regular expression for matching Ripple (XRP) addresses
~ ❯❯❯ npm install ripple-regex
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']
Returns a regex for matching XRP addresses.
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.
- 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.
MIT © Nikolaos Kamarinakis