开发者

Regular Expression vs KMP

开发者 https://www.devze.com 2023-01-07 09:36 出处:网络
Hi can any one tell me why there we are not using Knuth Morris Pratt algorithms in modern开发者_JAVA技巧 programming practices and prefer regular expression more ?Is there more than one KMP algorithm?

Hi can any one tell me why there we are not using Knuth Morris Pratt algorithms in modern开发者_JAVA技巧 programming practices and prefer regular expression more ?


Is there more than one KMP algorithm? My understanding is that there is one algorithm for performing a search for a string within another string. Regex is much more flexible - and there's no reason why a very simple regex expression couldn't use KMP - it's up to the implementor.

0

精彩评论

暂无评论...
验证码 换一张
取 消