Beispiel #1
0
        /// <summary>
        ///   Find the extent of the first match.
        /// </summary>
        /// <param name="haystack">The UTF8 bytes to search for this pattern</param>
        /// <param name="offset">The offset to start searching at</param>
        public Match Find(byte[] haystack, uint offset)
        {
            var matchInfo = new RureMatch();

            var matched = RureFfi.rure_find(
                Raw, haystack,
                new UIntPtr((uint)haystack.Length),
                new UIntPtr(offset),
                out matchInfo);

            return(new Match(haystack, matched, (uint)matchInfo.start, (uint)matchInfo.end));
        }