Skip to content
This repository has been archived by the owner on May 1, 2023. It is now read-only.

Adding an optional param for replacing string and case sensitivity. #71

Open
17gstyron opened this issue Nov 16, 2020 · 3 comments
Open

Comments

@17gstyron
Copy link

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.

@Jezternz
Copy link

Jezternz commented Dec 9, 2020

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

@17gstyron
Copy link
Author

17gstyron commented Feb 10, 2021

@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

@Jezternz
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants