Example #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);
        }
Example #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);
        }
Example #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);
        }
Example #4
0
        public void MatchSimpleString()
        {
            string pattern = @"hiho{(\d+)}bla";
            string value   = PatternMatching.MatchEmbeddedRegex(pattern, "hiho1234bla");

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