Input是一个Random String。利用REGEX怎样做模糊搜索?

假设有一个字符串,字符串内容是Random的,怎样用Elisp在Buffer里面找到一个类似的字符串(函数只接受两个参数,一个是给定的字符串,另外一个是模糊程度0到1),想了好久都不知道怎么搞,有高手给能些idea吗?

请舉个例子先

When you declare a variable using const, var, or let, you can optionally add a type annotation to explicitly specify the type of the variable.

我随便举5个例子,最后匹配的结果都是同一个。

Input,

  1. When you declare a variable using (Exact match, 1)
  2. When declare a variable using this annnotation.
  3. When declare a variable using…
  4. You declare a vaiable with
  5. Delcare (Most vague match, 0)

Output: When you declare a variable using const, var, or let, you can optionally add a type annotation to explicitly specify the type of the variable.

搜 “full text search engine”

如果有够头铁想从头写的话参考 https://artem.krylysov.com/blog/2020/07/28/lets-build-a-full-text-search-engine/

1 个赞