/// <summary> /// Get the Match at a given capture index /// <para> /// Returns detailed match information for the given capture group. /// </para> /// </summary> public Match this[int index] { get { var match = new RureMatch(); var matched = RureFfi.rure_captures_at(Raw, new UIntPtr((uint)index), out match); return(new Match(_haystack, matched, (uint)match.start, (uint)match.end)); } }
/// <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)); }
public MatchIter(Regex pattern, byte[] haystack) : base(pattern, haystack) { _matchInfo = new RureMatch(); }
public static extern bool rure_find(IntPtr re, byte[] haystack, UIntPtr length, UIntPtr start, out RureMatch match);
public static extern bool rure_captures_at(IntPtr captures, UIntPtr i, out RureMatch match);
public static extern bool rure_iter_next(IntPtr it, byte[] haystack, UIntPtr length, out RureMatch match);