public void MatchesBothUrlAndBody() { var matcher = new RegexMatcher("abcde"); Assert.True(matcher.Matches(new PathString("/foo/bar/ae/fx/"), new QueryString(), "content in body: abcde", null)); Assert.True(matcher.Matches(new PathString("/foo/bar/abcde/fx/"), new QueryString(), "", null)); }
public bool MatchAdvancedTest(string text, string regexp) { using (var rm = new RegexMatcher(regexp)) { return(rm.Matches(text)); } }
public bool MatchSimpleTest(string text) { using (var rm = new RegexMatcher("(a|b)*c")) { return(rm.Matches(text)); } }
public bool MatchWithCommentsAndSpace(string text) { using (var rm = new RegexMatcher("(?# space is ignored )(a | b)* c", RegexMatcher.URegexpFlag.COMMENTS)) { return(rm.Matches(text)); } }
Tuple <int, int>[] MatchAndPrintStats(RegexMatcher matcher, string input, string info) { var t = System.Environment.TickCount; var m = matcher.Matches(input); t = System.Environment.TickCount - t; Console.WriteLine("{2}) Match count={0}, time={1}ms", m.Length, t, info); return(m); }
public void MatchesQueryString() { var matcher = new RegexMatcher("abcde"); Assert.True(matcher.Matches(new PathString("/foo/bar/"), new QueryString("?value=abcde"), "", null)); }
public void NoMatch() { var matcher = new RegexMatcher("<ssn>13116900217</ssn>"); Assert.False(matcher.Matches(null, new QueryString(), BODY, null)); }
public void CanMatchBody() { var matcher = new RegexMatcher("<ssn>13116900216</ssn>"); Assert.True(matcher.Matches(null, new QueryString(), BODY, null)); }
public bool MatchSimpleTest(string text) { RegexMatcher rm = new RegexMatcher("(a|b)*c"); return(rm.Matches(text)); }