Good Python modules for fuzzy string comparison? [closed]

Closed. This question is opinion-based. It is not currently accepting answers. Closed 8 years ago. Locked. This question and its answers are locked because the question is off-topic but has historical significance. It is not currently accepting new answers or interactions. I’m looking for a Python module that can do simple fuzzy string comparisons. Specifically, … Read more

How can I do a case insensitive string comparison?

How can I make the line below case insensitive? drUser[“Enrolled”] = (enrolledUsers.FindIndex(x => x.Username == (string)drUser[“Username”]) != -1); I was given some advice earlier today that suggested I use: x.Username.Equals((string)drUser[“Username”], StringComparison.OrdinalIgnoreCase))); the trouble is I can’t get this to work, I’ve tried the line below, this compiles but returns the wrong results, it returns enrolled … Read more

Case-insensitive search

I’m trying to get a case-insensitive search with two strings in JavaScript working. Normally it would be like this: var string=”Stackoverflow is the BEST”; var result= string.search(/best/i); alert(result); The /i flag would be for case-insensitive. But I need to search for a second string; without the flag it works perfect: var string=”Stackoverflow is the BEST”; … Read more

How do I compare version numbers in Python?

I am walking a directory that contains eggs to add those eggs to the sys.path. If there are two versions of the same .egg in the directory, I want to add only the latest one. I have a regular expression r”^(?P<eggName>\w+)-(?P<eggVersion>[\d\.]+)-.+\.egg$ to extract the name and version from the filename. The problem is comparing the … Read more

MySQL query String contains

I’ve been trying to figure out how I can make a query with MySQL that checks if the value (string $haystack ) in a certain column contains certain data (string $needle), like this: SELECT * FROM `table` WHERE `column`.contains(‘{$needle}’) In PHP, the function is called substr($haystack, $needle), so maybe: WHERE substr(`column`, ‘{$needle}’)=1 8 Answers 8