Esempio n. 1
0
        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"));
        }
Esempio n. 2
0
        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));
        }
Esempio n. 3
0
 public PcreMatch Match(string subject, PcreMatchOptions options, Func <PcreCallout, PcreCalloutResult> onCallout)
 {
     return(Match(subject, 0, options, onCallout));
 }
Esempio n. 4
0
 public PcreMatch Match(string subject, PcreMatchOptions options)
 {
     return(Match(subject, 0, options, null));
 }
Esempio n. 5
0
 public PcreMatch Match(string subject, int startIndex, PcreMatchOptions options)
 {
     return(Match(subject, startIndex, options, null));
 }
Esempio n. 6
0
 public PcreRefMatch Match(ReadOnlySpan <char> subject, int startIndex, PcreMatchOptions options, PcreRefCalloutFunc onCallout)
 => Match(subject, PcreMatchSettings.GetSettings(startIndex, options, onCallout));
Esempio n. 7
0
 public static PatternOptions ToPatternOptions(this PcreMatchOptions options)
 {
     return((PatternOptions)((long)options & 0xFFFFFFFF));
 }
Esempio n. 8
0
 public PcreRefMatch Match(ReadOnlySpan <char> subject, PcreMatchOptions options, PcreRefCalloutFunc onCallout)
 => Match(subject, 0, options, onCallout);
Esempio n. 9
0
 public PcreMatch Match(string subject, int startIndex, PcreMatchOptions options, Func <PcreCallout, PcreCalloutResult> onCallout)
 => Match(subject, PcreMatchSettings.GetSettings(startIndex, options, onCallout));
Esempio n. 10
0
 public PcreRefMatch Match(ReadOnlySpan <char> subject, int startIndex, PcreMatchOptions options)
 => Match(subject, startIndex, options, null);
Esempio n. 11
0
 public PcreMatch Match(string subject, int startIndex, PcreMatchOptions options)
 => Match(subject, startIndex, options, null);
Esempio n. 12
0
 public PcreRefMatch Match(ReadOnlySpan <char> subject, PcreMatchOptions options)
 => Match(subject, 0, options, null);
Esempio n. 13
0
 public PcreMatch Match(string subject, PcreMatchOptions options)
 => Match(subject, 0, options, null);
Esempio n. 14
0
 public static uint ToPatternOptions(this PcreMatchOptions options)
 => (uint)((long)options & 0xFFFFFFFF);