https://github.com/k4m4/ripple-regex
Regular expression for matching Ripple (XRP) addresses.
https://github.com/k4m4/ripple-regex
cryptocurrency-regex matcher regex regex-match ripple xrp
Last synced: about 2 months ago
JSON representation
Regular expression for matching Ripple (XRP) addresses.
- Host: GitHub
- URL: https://github.com/k4m4/ripple-regex
- Owner: k4m4
- License: mit
- Created: 2018-02-24T21:43:59.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-05T16:13:49.000Z (over 2 years ago)
- Last Synced: 2025-04-22T17:13:18.210Z (2 months ago)
- Topics: cryptocurrency-regex, matcher, regex, regex-match, ripple, xrp
- Language: JavaScript
- Size: 1.15 MB
- Stars: 7
- Watchers: 3
- Forks: 2
- Open Issues: 9
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# ripple-regex [](https://travis-ci.org/k4m4/ripple-regex) [](https://github.com/xojs/xo)
> Regular expression for matching Ripple (XRP) addresses
## Install
```
~ ❯❯❯ npm install ripple-regex
```## Usage
```js
const rippleRegex = require('ripple-regex');rippleRegex().test('nodejsrocks rG2ZJRab3EGBmpoxUyiF2guB3GoQTwMGEC');
//=> truerippleRegex({exact: true}).test('nodejsrocks rG2ZJRab3EGBmpoxUyiF2guB3GoQTwMGEC foo');
//=> falserippleRegex({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](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.
- [monero-regex](https://github.com/k4m4/monero-regex) - Regular expression for matching Monero (XMR) addresses.
- [bitcoincash-regex](https://github.com/k4m4/bitcoincash-regex) - Regular expression for matching Bitcoin Cash (BCH) addresses.
- [neo-regex](https://github.com/k4m4/neo-regex) - Regular expression for matching NEO addresses.
- [dash-regex](https://github.com/k4m4/dash-regex) - Regular expression for matching Dash addresses.
- [dogecoin-regex](https://github.com/k4m4/dogecoin-regex) - Regular expression for matching Dogecoin (DOGE) addresses.## License
MIT © [Nikolaos Kamarinakis](https://nikolaskama.me)