# regex-input-string

> Augment a user-input string into a regular expression.

Latest version **1.0.0** (published 2016-04-30) · ISC license · 0 weekly downloads

## Install

```sh
npm install regex-input-string
pnpm add regex-input-string
yarn add regex-input-string
bun add regex-input-string
```

## 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.0 |
| Published | 2016-04-30 |
| First published | 2016-04-30 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | mismith |
| Keywords | regex, regexp, user, input, string, auto, detect |

## Links

- npm: https://www.npmjs.com/package/regex-input-string
- npm.io page: https://npm.io/package/regex-input-string

## Alternatives

- [@mce/gif](https://npm.io/package/@mce/gif.md) — 2.6K weekly downloads
- [cleanse](https://npm.io/package/cleanse.md) — 173 weekly downloads
- [str](https://npm.io/package/str.md) — 127 weekly downloads
- [naming](https://npm.io/package/naming.md) — 95 weekly downloads
- [tap-telco-api](https://npm.io/package/tap-telco-api.md) — 19 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2016-04-30

## README

# regex-input-string

Augment a user-input string into a regular expression.

## Usage

`new RegexInputString(input: String, flags: String = ''): RegExp`

### Simple strings
    let r1 = new RegexInputString('either an? (escaped) string');
    // r1 === /either an\? \(escaped\) string/

### Regex strings
    let r2 = new RegexInputString('/^or an (improved|augmented) regexp? string/ig');
    // r2 === /^or an (improved|augmented) regexp? string/ig

### Filtering
Useful for filtering items based on a text input (where advanced users can perform regex searches), e.g.

    <input value="/^regexp? query$/ig" />

    inputEl.addEventListener('input', e => {
        let filter   = new RegexInputString(e.target.value, 'i')),
            filtered = items.filter(item => filter.test(item.name));
    });

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