示例#1
0
        public void NotMatched()
        {
            string pattern = @"http://bla.de?hiho.x={(\d+)}";
            string value   = PatternMatching.MatchEmbeddedRegex(pattern, "http://bla.de?hiho.x=bfd");

            Assert.AreEqual(null, value);
        }
示例#2
0
        public void MatchWithEscape()
        {
            string pattern = @"http://bla.de?hiho.x={(\d+)}";
            string value   = PatternMatching.MatchEmbeddedRegex(pattern, "http://bla.de?hiho.x=438");

            Assert.AreEqual("438", value);
        }
示例#3
0
        public void NoEmbeddedRegEx()
        {
            string pattern = @"http://bla.de?hiho.x=";
            string value   = PatternMatching.MatchEmbeddedRegex(pattern, "http://bla.de?hiho.x=");

            Assert.AreEqual(null, value);
        }
示例#4
0
        public void MatchSimpleString()
        {
            string pattern = @"hiho{(\d+)}bla";
            string value   = PatternMatching.MatchEmbeddedRegex(pattern, "hiho1234bla");

            Assert.AreEqual("1234", value);
        }