Hi can any one tell me why there we are not using Knuth Morris Pratt algorithms in modern programming practices and prefer regular expression more ?
+1
A:
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.
Will A
2010-07-11 23:37:12
The other algorithm is boyer-Moore, its borrows some KMP i guess.The following link says, the way we compute next shift during mis-match is somewhat similar to finite automaton. Having said that, I'm assuming our Regex has some KMP in it. http://www.ics.uci.edu/~eppstein/161/960227.html
ram
2010-07-13 00:02:26
Whichever way, ram, regex works and it works well - don't fix what ain't broken! :)
Will A
2010-07-13 00:15:39