예제 #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);
        }