Regular Expression vs KMP
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.
精彩评论