npm.io
0.1.1 • Published 6 years ago

strsearch2regexp

Licence
MIT
Version
0.1.1
Deps
0
Size
3 kB
Vulns
0
Weekly
0

strsearch2regexp

Converts a search string to a unicode regexp with character variants (e.g. "foo bar" -> "f[oöó][oöó].*b[aäá]r")

This code is far from complete. Pull requests are very welcome!

Installation

npm add --save strsearch2regexp

Usage

const strsearch2regexp = require('strsearch2regexp')

console.log(strsearch2regexp('foo bar'))
// f[oòóôõöø]o.*b[aàáâãäå]r