Skip to content

Latest commit

 

History

History
38 lines (29 loc) · 1016 Bytes

File metadata and controls

38 lines (29 loc) · 1016 Bytes

FuzzyMatch

JavaScript proof-of-concept fuzzy match working with RegEx.

##Demo Here is a simple implementation

Usage

Checking if match is found

fuzzyMatch.prep('Searching');
console.log(fuzzyMatch.match('I was searching for this'));
console.log(fuzzyMatch.match('I failed to find anything ;('));

Highlighting entire blocks

fuzzyMatch.prep('Searching');
console.log(fuzzyMatch.hiblock('I was searching for this'));
console.log(fuzzyMatch.hiblock('I failed to find anything ;('));

Highlighting individual letters

fuzzyMatch.prep('Searching');
console.log(fuzzyMatch.hi('I was searching for this'));
console.log(fuzzyMatch.hi('I failed to find anything ;('));

FAQ

  1. Why prep?

    That's because you are searching for one string over hundreads of lines of text. prep pre-caches the search query to make the script run faster.

  2. Why 'regex'?

    Because I can :)