# String Matching

## Tools

1. [**Fuzzy string matching library - fuzzywuzzy - using edit-distance**](https://towardsdatascience.com/natural-language-processing-for-fuzzy-string-matching-with-python-6632b7824c49)
2. [**Difflib**](https://docs.python.org/3/library/difflib.html)**,** [**difflib**](https://pymotw.com/2/difflib/)**-2**

![Susan Li, Fuzzy Wuzzy String Matching, medium.com](https://lh6.googleusercontent.com/y0wbP76ObQPtAtaM-hXk0uwO1-rtcRXfcB7wEZbbPCE05FexzLYfJZtXRO9GkNGcnAOfyxTuRQDRUszfFL5qz7waIBtYnDiJrceyFl_-8rs82yAZdmcoNVKtDU9EgPgHwT9bTy4z)

## **REGEX**

1. [**Why re is slow** ](https://swtch.com/~rsc/regexp/regexp1.html)
2. [**Benchmark**](https://github.com/mariomka/regex-benchmark)**,** [**comparisons**](https://rust-leipzig.github.io/regex/2017/03/28/comparison-of-regex-engines/)**,** [**more**](https://stackoverflow.com/questions/3544225/regular-expression-library-benchmarks)**,** [**many more**](https://stackoverflow.com/questions/11033190/regex-library-benchmark)**,**&#x20;
3. [**Split on separator but keep the separator**](http://programmaticallyspeaking.com/split-on-separator-but-keep-the-separator-in-python.html)**, in Python**
4. [**Semantic versioning**](https://regexr.com/39s32)
5. [**Hyperscan**](https://github.com/intel/hyperscan) **-** [**Hyperscan**](https://www.hyperscan.io/) [**(paper)**](https://www.usenix.org/system/files/nsdi19-wang-xiang.pdf) **is a high-performance multiple regex matching library. It follows the regular expression syntax of the commonly-used libpcre library, but is a standalone library with its own C API.**
6. [**Re2**](https://github.com/google/re2/tree/abseil/python) **-** [**python**](https://pypi.org/project/re2/) **This is the source code repository for RE2, a regular expression library.**

![](https://lh3.googleusercontent.com/-YwR-w4Xp3Z-FJH4yUu23QiFSBgr7EqkKGNhvG-c89kpsaHcEBeiqiUO4nEx-8VzEMIeaJosCR6JhDpWO5hqQjfwL2cSXUXapt_XUa_OdRmClhigiynQzDBy3zdrq_Bj4VYaWv2F)

1. [**Spacy’s Matcher & “regex”**](https://spacy.io/usage/rule-based-matching)
2. [**Flashtext**](https://github.com/vi3k6i5/flashtext)**- This module can be used to replace keywords in sentences or extract keywords from sentences. It is based on the** [**FlashText algorithm**](https://arxiv.org/abs/1711.00046)**.**


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.mlcompendium.com/natural-language-processing/string-matching.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
