Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stevenvachon/any-match
Determine if a single match exists with an array of strings/numbers/regexes.
https://github.com/stevenvachon/any-match
match nodejs regex regexp
Last synced: 2 months ago
JSON representation
Determine if a single match exists with an array of strings/numbers/regexes.
- Host: GitHub
- URL: https://github.com/stevenvachon/any-match
- Owner: stevenvachon
- License: mit
- Created: 2017-05-08T21:08:08.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2021-02-25T16:04:11.000Z (almost 4 years ago)
- Last Synced: 2024-10-06T04:24:01.899Z (3 months ago)
- Topics: match, nodejs, regex, regexp
- Language: JavaScript
- Homepage:
- Size: 3.91 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# any-match [![NPM Version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Monitor][greenkeeper-image]][greenkeeper-url]
> Determine if a single match exists with an array of strings/numbers/regexes.
## Installation
[Node.js](http://nodejs.org/) `>= 6` is required. To install, type this at the command line:
```shell
npm install any-match
```## Usage
```js
const anyMatch = require('any-match');anyMatch('a', ['a', 'b']); //-> true
anyMatch('c', ['a', 'b']); //-> falseanyMatch(1, [0, 1]); //-> true
anyMatch('abc', [/^abc$/]); //-> true
```[npm-image]: https://img.shields.io/npm/v/any-match.svg
[npm-url]: https://npmjs.com/package/any-match
[travis-image]: https://img.shields.io/travis/stevenvachon/any-match.svg
[travis-url]: https://travis-ci.org/stevenvachon/any-match
[greenkeeper-image]: https://badges.greenkeeper.io/stevenvachon/any-match.svg
[greenkeeper-url]: https://greenkeeper.io/