Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

quotemeta

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

quotemeta

escape regular expression characters

  • 0.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
25K
decreased by-11.09%
Maintainers
1
Weekly downloads
 
Created
Source

quotemeta

escape regular expression metacharacters

This module is like perl's quotemeta without the part about \Q...\E.

build status

browser support

example

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

var quotemeta = require('quotemeta')

var escaped = quotemeta(string)

Return string with metacharacters escaped with \s.

install

With npm do:

npm install quotemeta

license

MIT

Keywords

FAQs

Package last updated on 30 Dec 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc