string-similarity icon indicating copy to clipboard operation
string-similarity copied to clipboard

Adding an optional param for replacing string and case sensitivity.

Open 17gstyron opened this issue 4 years ago • 3 comments

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.

17gstyron avatar Nov 16 '20 21:11 17gstyron

Case insensitivity would be great! Also for findBestMatch() would be awesome.

Jezternz avatar Dec 09 '20 12:12 Jezternz

@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 avatar Feb 10 '21 16:02 17gstyron

@17gstyron I really like your implementation! - it would be great to see a side-by-side perf comparison, npm module? :D

Jezternz avatar Feb 11 '21 08:02 Jezternz