public void should_match_partially(PcreMatchOptions options) { var re = new PcreRegex(@"(?<=abc)123"); var match = re.Match("xyzabc12", options); Assert.That(match.Success, Is.False); Assert.That(match.IsPartialMatch, Is.True); Assert.That(match.Index, Is.EqualTo(6)); Assert.That(match.EndIndex, Is.EqualTo(8)); Assert.That(match.Length, Is.EqualTo(2)); Assert.That(match.Value, Is.EqualTo("12")); }
public PcreMatch Match(string subject, int startIndex, PcreMatchOptions options, Func <PcreCallout, PcreCalloutResult> onCallout) { var settings = new PcreMatchSettings { StartIndex = startIndex, AdditionalOptions = options }; if (onCallout != null) { settings.OnCallout += onCallout; } return(Match(subject, settings)); }
public PcreMatch Match(string subject, PcreMatchOptions options, Func <PcreCallout, PcreCalloutResult> onCallout) { return(Match(subject, 0, options, onCallout)); }
public PcreMatch Match(string subject, PcreMatchOptions options) { return(Match(subject, 0, options, null)); }
public PcreMatch Match(string subject, int startIndex, PcreMatchOptions options) { return(Match(subject, startIndex, options, null)); }
public PcreRefMatch Match(ReadOnlySpan <char> subject, int startIndex, PcreMatchOptions options, PcreRefCalloutFunc onCallout) => Match(subject, PcreMatchSettings.GetSettings(startIndex, options, onCallout));
public static PatternOptions ToPatternOptions(this PcreMatchOptions options) { return((PatternOptions)((long)options & 0xFFFFFFFF)); }
public PcreRefMatch Match(ReadOnlySpan <char> subject, PcreMatchOptions options, PcreRefCalloutFunc onCallout) => Match(subject, 0, options, onCallout);
public PcreMatch Match(string subject, int startIndex, PcreMatchOptions options, Func <PcreCallout, PcreCalloutResult> onCallout) => Match(subject, PcreMatchSettings.GetSettings(startIndex, options, onCallout));
public PcreRefMatch Match(ReadOnlySpan <char> subject, int startIndex, PcreMatchOptions options) => Match(subject, startIndex, options, null);
public PcreMatch Match(string subject, int startIndex, PcreMatchOptions options) => Match(subject, startIndex, options, null);
public PcreRefMatch Match(ReadOnlySpan <char> subject, PcreMatchOptions options) => Match(subject, 0, options, null);
public PcreMatch Match(string subject, PcreMatchOptions options) => Match(subject, 0, options, null);
public static uint ToPatternOptions(this PcreMatchOptions options) => (uint)((long)options & 0xFFFFFFFF);