Socket
Book a DemoInstallSign in
Socket

regex-arg

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

regex-arg

quick and dirty parse regex literal to regexp object from user input

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

regex-arg

take an input string in regex literal format and return it as a regex with flags. uses safe-regex to ensure that user provided regex can't take down the server.

var re = require('regex-arg')

var string = "/hi/i"

re(string).test("HI") === true

api

  • regexArg = require('regex-arg')
  • regexArg(string, unsafe)
    • string, the regex to make
    • if unsafe is truthy allow unsafe regexps to return from this function. warning these can take down your server so only unsafe regex that are trusted should be used and should really really be rewritten,

Keywords

regexp

FAQs

Package last updated on 25 Aug 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