コード例 #1
0
ファイル: MatchTests.cs プロジェクト: sivakumarganga/pcre-net
        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"));
        }
コード例 #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));
        }
コード例 #3
0
 public PcreMatch Match(string subject, PcreMatchOptions options, Func <PcreCallout, PcreCalloutResult> onCallout)
 {
     return(Match(subject, 0, options, onCallout));
 }
コード例 #4
0
 public PcreMatch Match(string subject, PcreMatchOptions options)
 {
     return(Match(subject, 0, options, null));
 }
コード例 #5
0
 public PcreMatch Match(string subject, int startIndex, PcreMatchOptions options)
 {
     return(Match(subject, startIndex, options, null));
 }
コード例 #6
0
 public PcreRefMatch Match(ReadOnlySpan <char> subject, int startIndex, PcreMatchOptions options, PcreRefCalloutFunc onCallout)
 => Match(subject, PcreMatchSettings.GetSettings(startIndex, options, onCallout));
コード例 #7
0
 public static PatternOptions ToPatternOptions(this PcreMatchOptions options)
 {
     return((PatternOptions)((long)options & 0xFFFFFFFF));
 }
コード例 #8
0
 public PcreRefMatch Match(ReadOnlySpan <char> subject, PcreMatchOptions options, PcreRefCalloutFunc onCallout)
 => Match(subject, 0, options, onCallout);
コード例 #9
0
 public PcreMatch Match(string subject, int startIndex, PcreMatchOptions options, Func <PcreCallout, PcreCalloutResult> onCallout)
 => Match(subject, PcreMatchSettings.GetSettings(startIndex, options, onCallout));
コード例 #10
0
 public PcreRefMatch Match(ReadOnlySpan <char> subject, int startIndex, PcreMatchOptions options)
 => Match(subject, startIndex, options, null);
コード例 #11
0
 public PcreMatch Match(string subject, int startIndex, PcreMatchOptions options)
 => Match(subject, startIndex, options, null);
コード例 #12
0
 public PcreRefMatch Match(ReadOnlySpan <char> subject, PcreMatchOptions options)
 => Match(subject, 0, options, null);
コード例 #13
0
 public PcreMatch Match(string subject, PcreMatchOptions options)
 => Match(subject, 0, options, null);
コード例 #14
0
 public static uint ToPatternOptions(this PcreMatchOptions options)
 => (uint)((long)options & 0xFFFFFFFF);