string-similarity
string-similarity copied to clipboard
Adding an optional param for replacing string and case sensitivity.
I am using compareTwoStrings in my own projects and have found a lot of use in having an optional parameter where you can give regex/string to replace by. In my recent implementation I needed to exclude special characters. Having the parameter allowed me to just add that bit of regex in my call like so: compareTwoStrings('hello', 'hey', /[^\w\s]/gi). I also added option to remove case sensitivity. I would love to contribute these features.
Case insensitivity would be great! Also for findBestMatch() would be awesome.
@Jezternz I've made my own implementation of Dice's distance in my useless-utils repo if you want to take a look! https://github.com/17gstyron/useless-utils/blob/master/stringSimilarity.js
@17gstyron I really like your implementation! - it would be great to see a side-by-side perf comparison, npm module? :D