by acbart · 11y ago · 0 comments
fuzzysearch('twl', 'cartwheel') // <- true
The string 'cartwheel' does not contain the string 'twl' directly. new RegExp("twl".split("").join("(.+)?")).test("cartwheel")
does approximately the same, no?You can also use ".*" to replace "(.+)?" in your regex.