Socket
Socket
Sign inDemoInstall

lodash.escaperegexp

Package Overview
Dependencies
1
Maintainers
5
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

lodash.escaperegexp


Version published
Maintainers
5
Created

Package description

What is lodash.escaperegexp?

The lodash.escaperegexp package is a utility function from the Lodash library that escapes the special characters in a string to be used in a regular expression. This is particularly useful when you need to create a regular expression from user input or other dynamic sources.

What are lodash.escaperegexp's main functionalities?

Escape special characters in a string

This feature allows you to escape special characters in a string so that it can be safely used in a regular expression. In the example, the string '[lodash](https://lodash.com/)' is escaped to '\[lodash\]\(https://lodash\.com/\)'.

const escapeRegExp = require('lodash.escaperegexp');
const escapedString = escapeRegExp('[lodash](https://lodash.com/)');
console.log(escapedString); // Output: \[lodash\]\(https://lodash\.com/\)

Other packages similar to lodash.escaperegexp

Readme

Source

lodash.escaperegexp v3.0.1

The modern build of lodash’s _.escapeRegExp exported as a Node.js/io.js module.

Installation

Using npm:

$ {sudo -H} npm i -g npm
$ npm i --save lodash.escaperegexp

In Node.js/io.js:

var escapeRegExp = require('lodash.escaperegexp');

See the documentation or package source for more details.

Keywords

FAQs

Last updated on 30 Jun 2015

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc