コード例 #1
0
 public void RegexMatches_StartOrEndForEmpty()
 {
     IExpression<char> expression =
     new AlternationExpression<char>(
        new StartExpression<char> (),
        new EndExpression<char> ());
      string regex = @"^|$";
      expression.AssertMatches ("", regex);
 }
コード例 #2
0
 public void RegexMatches_AAorAB()
 {
     IExpression<char> expression =
     new AlternationExpression<char>(
        new ListExpression<char> (
           new CharClass ('A'),
           new CharClass ('A')),
        new ListExpression<char> (
           new CharClass ('A'),
           new CharClass ('B'))
           );
      string regex = @"(AA)|(AB)";
      expression.AssertMatches ("AAABAB", regex);
      expression.AssertMatches ("00000000000000AAABAB000000", regex);
 }