通配符字符串匹配

编程入门 行业动态 更新时间:2024-10-25 09:24:17
本文介绍了通配符字符串匹配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

什么是最有效的通配符字符串匹配算法?我问大约只有一个想法,这是没有必要提供实际的code。

What is the most efficient wildcard string matching algorithm? I am asking only about an idea, it is not necessary to provide actual code.

我在想,这样的算法可以排序的后缀阵列被修建,这可以产生澳性能(的log(n))。

I'm thinking that such algorithm can be built with sorted suffix arrays, which can yield performance of O(log(n)).

我是正确的?

编辑:

我的意思是像A * B,* SIP *或A?B,其中星意味着任意数量的符号和问号表示单个符号。

I mean patterns like "A*B", "*sip*" or "A?B" where star means any number of symbols and question mark means single symbol.

推荐答案

有一个纸覆盖最快的选择这里 swtch/~rsc/regexp/regexp1.html 特别是它可以让你避免天真的算法,变长模式使用时,异常地慢。

There is a paper covering the fastest options here swtch/~rsc/regexp/regexp1.html in particular it allows you avoid naive algorithms that become pathologically slow when long patterns are used.

它涵盖了普通的常规EX pressions但你可以限制你实现你所需要的子集。

It covers generic regular expressions but you can limit your implementation to the subset you require.

更多推荐

通配符字符串匹配

本文发布于:2023-10-24 14:53:44,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1524231.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:通配符   字符串

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!