wild
Generate regexp by wildcard string
Installation
npm i wild
Api
wild(str[, isStrict])
=> return regexp
if isStrict is true, wild will return regexp like /^ ... $/
Usage
wild only cares about the wildcard *
, and escape other special chars in regexp
var wild = var reg = // => /^http:\/\/google\.com\/.*$/ reg// => true
Advanced
get source by wild.source
wildsource'http://google.com/*'// => 'http://google\\.com/.*' // different with raw source source// => 'http:\/\/google\.com\/.*'