Example #1
0
        /// <summary>
        /// Return all matches of the pattern in specified text using the Horspool algorithm
        /// </summary>
        /// <param name="text">text to be searched</param>
        /// <param name="pattern">pattern to match</param>
        /// <param name="startIndex">Index at which search begins</param>
        /// <returns>IEnumerable which returns the indexes of pattern matches</returns>
        public static IEnumerable <int> HorspoolMatch(this String text, String pattern, int startIndex)
        {
            var boyerMoor = new BoyerMoore(pattern);

            return(boyerMoor.HorspoolMatch(text, startIndex));
        }