JavaScript proof-of-concept fuzzy match working with RegEx.
##Demo Here is a simple implementation
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 ;('));-
Why
prep?That's because you are searching for one string over hundreads of lines of text.
preppre-caches the search query to make the script run faster. -
Why 'regex'?
Because I can :)