public void CheckSequenceIntoAGivenTextReturnRemainingText() { var many = new Many(new Sequence( new Character('u'), new Range('0', '9'), new Range('0', '9'))); Assert.Equal("bc567", many.Match("u12bc567").RemainingText()); }
public void UseListMethodWithComplexStringReturnRemainingText() { var digits = new OneOrMore(new Range('0', '9')); var whitespace = new Many(new Any(" \r\n\t")); var separator = new Sequence(whitespace, new Character(';'), whitespace); var list = new List(digits, separator); Assert.Equal("", list.Match("1; 22;\n 333 \t; 22").RemainingText()); }
public void CheckSameCharIntoAGivenTextReturnRemainingText() { var many = new Many(new Character('a')); Assert.Equal("bc", many.Match("aaabc").RemainingText()); }
public void CheckRangeIntoAGivenTextReturnRemainingText() { var many = new Many(new Range('0', '9')); Assert.Equal("bc567", many.Match("1234bc567").RemainingText()); }