Giter Club home page Giter Club logo

monero-regex's Introduction

monero-regex Build Status XO code style

Regular expression for matching Monero (XMR) addresses

Install

~ ❯❯❯ npm install monero-regex

Usage

const moneroRegex = require('monero-regex');

moneroRegex().test('nodejsrocks 47BnvD18P456f4KJUBKPS3Rqa97LrTaeqJ5NFYmjQM6nVoz6TBv4rJ24GZk883BNo22fAKbr8BSuTjhQC6K7DsSJFa8SHDs');
//=> true

moneroRegex({exact: true}).test('nodejsrocks 47BnvD18P456f4KJUBKPS3Rqa97LrTaeqJ5NFYmjQM6nVoz6TBv4rJ24GZk883BNo22fAKbr8BSuTjhQC6K7DsSJFa8SHDs foo');
//=> false

moneroRegex({exact: true}).test('47BnvD18P456f4KJUBKPS3Rqa97LrTaeqJ5NFYmjQM6nVoz6TBv4rJ24GZk883BNo22fAKbr8BSuTjhQC6K7DsSJFa8SHDs');
//=> true

'nodejsrocks 47BnvD18P456f4KJUBKPS3Rqa97LrTaeqJ5NFYmjQM6nVoz6TBv4rJ24GZk883BNo22fAKbr8BSuTjhQC6K7DsSJFa8SHDs unicorn 42oAxV3DVXXG3HhyCyi2xaPukKXbip9Sx1YuJtoCqjZRSze4tYCq7n3VUswDBFV59Zev8yfHSZro4TUwXumtRWnQ8xQipkC rainbow'.match(moneroRegex());
//=> ['47BnvD18P456f4KJUBKPS3Rqa97LrTaeqJ5NFYmjQM6nVoz6TBv4rJ24GZk883BNo22fAKbr8BSuTjhQC6K7DsSJFa8SHDs', '42oAxV3DVXXG3HhyCyi2xaPukKXbip9Sx1YuJtoCqjZRSze4tYCq7n3VUswDBFV59Zev8yfHSZro4TUwXumtRWnQ8xQipkC']

API

moneroRegex([options])

Returns a regex for matching Monero (XMR) addresses.

options.exact

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

Only match an exact string. Useful with RegExp#test() to check if a string is an XMR 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.
  • 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.
  • dogecoin-regex - Regular expression for matching Dogecoin (DOGE) addresses.

License

MIT © Nikolaos Kamarinakis

monero-regex's People

Contributors

dependabot[bot] avatar k4m4 avatar tobtoht avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.