正则表达式中的莱文斯坦距离 [英] Levenshtein distance in regular expression

查看:48
本文介绍了正则表达式中的莱文斯坦距离的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在正则表达式查询中包含 Levenshtein 距离?

Is it possible to include Levenshtein distance in a regular expression query?

(除了在排列之间建立联合,像这样用 Levenshtein 距离 1 搜索hello":

(Except by making union between permutations, like this to search for "hello" with Levenshtein distance 1:

.ello | h.llo | he.lo | hel.o | hell.

因为这很愚蠢并且无法用于更大的 Levenshtein 距离.)

since this is stupid and unusable for larger Levenshtein distances.)

推荐答案

是否有可能如何在正则表达式查询中包含编辑距离?

is there possiblity how to include levenshtein distance in regular expression query?

不,不是以一种理智的方式.实施 - 或使用现有 - Levenshtein 距离算法是要走的路.

No, not in a sane way. Implementing - or using an existing - Levenshtein distance algorithm is the way to go.

这篇关于正则表达式中的莱文斯坦距离的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆