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

regexp-escape-x

Package Overview
Dependencies
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

regexp-escape-x

ECMAScript proposed RegExp.escape.

  • 1.4.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
increased by33.33%
Maintainers
1
Weekly downloads
 
Created
Source

Travis status Dependency status devDependency status npm version

regexp-escape-x

ECMAScript proposed RegExp.escape.

See: RegExp.escape
Version: 1.4.1
Author: Xotic750 Xotic750@gmail.com
License: MIT
Copyright: Xotic750

module.exports(string)string

Method to safely escape RegExp special tokens for use in new RegExp.

Kind: Exported function
Returns: string - The escaped string.

ParamTypeDescription
stringstringThe string to be escaped.

Example

var regexpEscape = require('regexp-escape-x');
var str = 'hello. how are you?';
var regex = new RegExp(regexpEscape(str), 'g');
String(regex); // '/hello\. how are you\?/g'

Keywords

FAQs

Package last updated on 01 Sep 2017

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