# quotemeta

> escape regular expression characters

Latest version **0.0.0** (published 2012-12-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install quotemeta
pnpm add quotemeta
yarn add quotemeta
bun add quotemeta
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.0 |
| Published | 2012-12-30 |
| First published | 2012-12-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | James Halliday |
| Maintainers | substack |
| Keywords | regex, RegExp, escape, backslash, \, quote |

## Links

- npm: https://www.npmjs.com/package/quotemeta
- Repository: https://github.com/substack/quotemeta
- npm.io page: https://npm.io/package/quotemeta

## Recent versions

- 0.0.0 (latest) — 2012-12-30

## README

# quotemeta

escape regular expression metacharacters

This module is like
[perl's quotemeta](http://perldoc.perl.org/functions/quotemeta.html)
without the part about `\Q...\E`.

[![build status](https://secure.travis-ci.org/substack/quotemeta.png)](http://travis-ci.org/substack/quotemeta)

[![browser support](http://ci.testling.com/substack/quotemeta.png)](http://ci.testling.com/substack/quotemeta)

# example

``` js
var quotemeta = require('quotemeta');

var query = new RegExp('\\d ' + quotemeta('node.js'));
var filter = function (x) { return query.test(x) };

var xs = [
    '0 node^js y',
    '1 node_js x',
    '2 node.js 5',
    '3 beep z',
    'X node.js Y',
    '4 boop w'
];
console.dir(xs.filter(filter));
```

# methods

``` js
var quotemeta = require('quotemeta')
```

## var escaped = quotemeta(string)

Return `string` with metacharacters escaped with `\`s.

# install

With [npm](https://npmjs.org) do:

```
npm install quotemeta
```

# license

MIT

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