/// <summary>
        /// Searches lines with specified needle and returns resulting collection
        /// </summary>
        /// <param name="__needle">The needle to search for or regex expression to test lines against</param>
        /// <param name="useRegex">if set to <c>true</c> it will interpret the needle as regex</param>
        /// <param name="limitResult">Result size limit - it stops the search procedure once the limit is reached. Leave it -1 to disable the limit</param>
        /// <param name="regexOptions">The regex options, used in combination with <c>useRegex</c> = true</param>
        /// <returns></returns>
        public fileTextSearchResult Search(String __needle, Boolean useRegex = false, Int32 limitResult = -1, RegexOptions regexOptions = RegexOptions.None)
        {
            fileTextSearchResult   output = new fileTextSearchResult(__needle, file.FullName, useRegex);
            fileTextOperaterWorker eval   = new fileTextOperaterWorker(__needle, useRegex, regexOptions);
            var map = GetTextMap();

            Boolean         limitOn = (limitResult > 0);
            ParallelOptions po      = new ParallelOptions();

            Parallel.ForEach(map, po, block =>
            {
                Int32 l      = block.lineStart;
                String match = "";
                foreach (String line in block)
                {
                    if (eval.evaluate(line, out match))
                    {
                        output.Add(l, line, false);
                    }
                    l++;

                    if (limitOn && (output.CountThreadSafe >= limitResult))
                    {
                        output.resultLimitTriggered = true;
                        break;
                    }
                }
            });

            return(output);
        }
        /// <summary>
        /// Searches the specified cached lines.
        /// </summary>
        /// <param name="cachedLines">The cached lines.</param>
        /// <param name="__needle">The needle.</param>
        /// <param name="useRegex">if set to <c>true</c> [use regex].</param>
        /// <param name="limitResult">The limit result.</param>
        /// <param name="regexOptions">The regex options.</param>
        /// <returns></returns>
        public fileTextSearchResult Search(fileTextLineCollection cachedLines, String __needle, Boolean useRegex = false, Int32 limitResult = -1, RegexOptions regexOptions = RegexOptions.None)
        {
            fileTextSearchResult   output = new fileTextSearchResult(__needle, file.FullName, useRegex);
            fileTextOperaterWorker eval   = new fileTextOperaterWorker(__needle, useRegex, regexOptions);

            foreach (var lp in cachedLines)
            {
                String match = "";
                if (eval.evaluate(lp.Value, out match))
                {
                    output.Add(lp.Key, lp.Value, false);
                }

                if (output.CountThreadSafe > limitResult)
                {
                    output.resultLimitTriggered = true;
                    break;
                }
            }
            return(output);
        }