# regex-collection

> Useful regex patterns and functions to test them.

Latest version **1.0.1** (published 2019-08-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install regex-collection
pnpm add regex-collection
yarn add regex-collection
bun add regex-collection
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2019-08-07 |
| First published | 2019-08-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 26.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | MarvinJWendt |
| Maintainers | marvinjwendt |
| Keywords | regex, test, pattern, match, string |

## Links

- npm: https://www.npmjs.com/package/regex-collection
- Repository: https://github.com/1337z/regex-collection
- Homepage: https://github.com/1337z/regex-collection#readme
- Issues: https://github.com/1337z/regex-collection/issues
- npm.io page: https://npm.io/package/regex-collection

## Alternatives

- [duck](https://npm.io/package/duck.md) — 4.2M weekly downloads
- [ava](https://npm.io/package/ava.md) — 560.2K weekly downloads
- [storybook-addon-module-mock](https://npm.io/package/storybook-addon-module-mock.md) — 71.7K weekly downloads
- [vest](https://npm.io/package/vest.md) — 50.1K weekly downloads
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2019-08-07
- 1.0.0 — 2019-08-07
- 1.0.0-1 — 2019-08-07
- 1.0.0-0 — 2019-08-07
- 0.7.0 — 2019-08-06
- 0.6.0 — 2019-08-06
- 0.5.1 — 2019-08-06
- 0.5.0 — 2019-08-06
- 0.4.1 — 2019-08-06
- 0.4.0 — 2019-08-06
- 0.3.3 — 2019-08-06
- 0.3.2 — 2019-08-06
- 0.3.1 — 2019-08-06
- 0.3.0 — 2019-08-06
- 0.2.1 — 2019-08-06
- … 5 more at https://npm.io/package/regex-collection/versions

## README

<p align="center"> 
<h1 align="center"> REGEX-COLLECTION </h1>
</p>
<p align="center"> 
  <img alt="NPM" src="https://img.shields.io/npm/l/regex-collection?style=flat-square">
  <img alt="CodeFactor Grade" src="https://img.shields.io/codefactor/grade/github/1337z/regex-collection?style=flat-square">
  <img alt="Travis (.org)" src="https://img.shields.io/travis/1337z/regex-collection?style=flat-square">
  <img alt="GitHub package.json version" src="https://img.shields.io/github/package-json/v/1337z/regex-collection?style=flat-square">
  <img alt="npm" src="https://img.shields.io/npm/dt/regex-collection?style=flat-square">
  <img alt="npm bundle size" src="https://img.shields.io/bundlephobia/min/regex-collection?style=flat-square">
</p>



> Useful regex patterns and functions to test them.

Currently using `268` tests for `9` functions to ensure accurate results!

## :white_check_mark: Supported patterns for:
- CSS comments
- Email addresses
- Full numbers / Integer
- Full numbers / Integer (Negative)
- Full numbers / Integer (Positive)
- Hex color codes
- IP addresses
- Telephone numbers

#### [Documentation :clipboard:](https://1337z.github.io/regex-collection/)

---

## :package: Install

```
npm i regex-collection
```

## :clipboard: Usage

### Importing
#### JavaScript
```javascript
const search = require('regex-collection')
```

#### TypeScript
```typescript
import * as search from 'regex-collection'
```

### Syntax
> The syntax is the same for JavaScript and TypeScript

#### `get` Get all occurrences of regex
```javascript
const text = "Hello World contact@example.com Bye World hello@world.com"

let result = search.getEmailAddress(text)
// => ["contact@example.com", "hello@world.com"]
```

#### `is` Check if a string matches to a regex
```javascript
const text = "Hello World contact@example.com Bye World hello@world.com"

let result = search.isEmailAddress(text)
// => false
```

```javascript
const text = "contact@example.com"

let result = search.isEmailAddress(text)
// => true
```

---
_Source: https://npm.io/package/regex-collection · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
