阿帕奇的StringUtils.contains和博耶

编程入门 行业动态 更新时间:2024-10-13 06:13:13
本文介绍了阿帕奇的StringUtils.contains和博耶 - 穆尔字符串搜索算法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

要搜索S在S(尺码(S)> =大小(S),并返回一个真/假值),这是更好的性能,使用的Apache StringUtils.contains()或使用博耶 - 穆尔算法实现,有人我发现测试呢?

To search for s in S (size(S) >= size(s) and return a true/false value), it's better for performance to use StringUtils.contains() of Apache or use Boyer-Moore algorithm implemented and tested well by someone I found?

感谢

推荐答案

在我最后一次看到Java的正则表达式匹配code,而调试,Java 7的正则表达式引擎所使用的博耶 - 穆尔算法文字文本序列匹配。所以,最简单的方法来找到字符串使用博耶 - 穆尔是prepare使用 P = Patternpile(searchString,Pattern.LITERAL) 和搜索使用 p.matcher(toSearchOn).find()。没有第三方库和不需要手工工作。我相信JRE类测试,以及...

The last time I looked into the Java regex matching code while debugging, the Java 7 regex engine used the Boyer-Moore algorithm for sequences of literal text matches. So the easiest way to find a String using Boyer-Moore is to prepare using p=Patternpile(searchString, Pattern.LITERAL) and search using p.matcher(toSearchOn).find(). No third party libraries and no handcrafted work needed. And I believe the JRE classes are tested well…

更多推荐

阿帕奇的StringUtils.contains和博耶

本文发布于:2023-11-30 09:07:04,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1649462.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:阿帕奇   StringUtils

发布评论

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

>www.elefans.com

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