# fast-regex

> Premade regex templates

Latest version **1.1.1** (published 2023-04-17) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2023-04-17 |
| First published | 2023-04-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Axorax |
| Maintainers | axoraxdev |
| Keywords | regex, fast-regex, premade-regex, easy-regex, regular-expressions, regular-expression |

## Links

- npm: https://www.npmjs.com/package/fast-regex
- Repository: https://github.com/Axorax/fast-regex.js
- Homepage: https://github.com/Axorax/fast-regex.js#readme
- Issues: https://github.com/Axorax/fast-regex.js/issues
- npm.io page: https://npm.io/package/fast-regex

## Recent versions

- 1.1.1 (latest) — 2023-04-17
- 1.1.0 — 2023-04-17
- 1.0.0 — 2023-04-16
- 0.0.1 — 2023-04-16

## README

<p align="center"><img src="https://raw.githubusercontent.com/Axorax/fast-regex.js/main/fastRegex.svg"></p>

<p align="center">Premade <strong>regex</strong> templates</p>

<p align="center">Free and <a href="https://github.com/Axorax/fast-regex.js">open-source for anyone to contribute</a>!</p>

## 🔮 JavaScript Support

| Type     | Support |
| -------- | ------- |
| commonjs | ✅     |
| ES6      | ✅     |
| Browser  | ✅     |

<br>

## ⚙️ Installation

```js
npm i fast-regex
```

**CDN Links:**

- https://www.unpkg.com/fast-regex@1.1.1/fastRegex.js

- https://cdn.jsdelivr.net/npm/fast-regex@1.1.1/fastRegex.js

If you are using npm to install it and then running it on the browser then use:

```js
import fastRegex from './node_modules/fast-regex/fastRegex.js';
```

## 📖 Documentation

#### ▸ Example code:

```js
import { fastRegex } from 'fast-regex';

console.log(fastRegex('hasAlphanumeric').test('Hello world!'));

console.log(fastRegex('imgSrc').exec('<img src="hello-world.png">'));
```

#### ▸ Add your own regex:

```js
fastRegex({
    name: 'myCoolRegex',
    regex: '[0-2]'
});

console.log(fastRegex('myCoolRegex').test('69'));
```

#### ▸ Add your own regex with flags:

```js
fastRegex({
    name: 'myCoolRegexWithFlags',
    regex: '[a-z]',
    flags: 'g'
});
```

#### ▸ All regex codes:

```js
fastRegex('validEmail')
fastRegex('ipv4')
fastRegex('ipv6')
fastRegex('hasInteger')
fastRegex('hasAlphanumeric')
fastRegex('validPhone')
fastRegex('imgSrc')
fastRegex('validZipCode')
fastRegex('validTwitterUsername')
fastRegex('domain')
fastRegex('removeHtmlComments')
fastRegex('isPositiveInteger')
fastRegex('isNegativeInteger')
fastRegex('validCreditCard')
```

---

[Support me on Patreon](https://www.patreon.com/axorax) - 
[Check out my socials](https://github.com/axorax/socials)

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