npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

regex-arg

1.0.1

@soldair

npmHomeRepoSnykSocket
Downloads:0
$ npm install regex-arg
DailyWeeklyMonthlyYearly

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,