public void RegexWithWhiteSpaceIsValid() { const string input = "regex \".*\\.txt\""; RegexValue value = BasicParser.RegexValue.Parse(input); Assert.Equal(".*\\.txt", value.RegexPattern); Assert.Matches(value.Regex, "match.txt"); }
public QuestionDataResponseYear(TextData data) : base(data) { Type = QuestionDataType.ResponseYear; RegexValue <ZValue> value = data.Values["responseYear"]; Year = int.Parse((string)value.Value); ColumnIndex = value.Index; Length = value.Length; }
public QuestionDataQuestionNumber(TextData data) : base(data) { Type = QuestionDataType.QuestionNumber; RegexValue <ZValue> value = data.Values["questionNumber"]; QuestionNumber = int.Parse((string)value.Value); ColumnIndex = value.Index; Length = value.Length; }
public void RegexCanBeNegatedWithSpaceBeforeKeyword() { const string input = "! regex\".*\\.txt\""; RegexValue value = BasicParser.RegexValue.Parse(input); Assert.Equal(".*\\.txt", value.RegexPattern); // The actual regex is not negated. It is up to the user of RegexValue to check the Negated flag Assert.Matches(value.Regex, "match.txt"); }
public void Clear() { Type = TokenType.BooleanLiteral; Literal = null; Start = 0; End = 0; LineNumber = 0; LineStart = 0; _location = null; Precedence = 0; Octal = false; Head = false; Tail = false; RawTemplate = null; BooleanValue = false; NumericValue = 0; Value = null; RegexValue = null; }