enhanced date support
diff --git a/src/main/antlr/CollectionQuery.g4 b/src/main/antlr/CollectionQuery.g4
index 3d6aaa8..bf9422f 100644
--- a/src/main/antlr/CollectionQuery.g4
+++ b/src/main/antlr/CollectionQuery.g4
@@ -42,14 +42,17 @@
fragment NO_RE : ~[ \t\/];
fragment ALPHABET : ~('\t' | ' ' | '/' | '*' | '?' | '+' | '{' | '}' | '[' | ']'
| '(' | ')' | '|' | '"' | ',' | ':' | '\'' | '\\' | '!' | '=' | '~' | '&' | '^' | '<' | '>' );
+fragment ALPHA : [a-zA-Z];
DIGIT : [0-9];
-NUMBER : [0-9]+;
+
+DATE
+: DIGIT DIGIT DIGIT DIGIT (DASH DIGIT DIGIT (DASH DIGIT DIGIT)?)?
+;
NL : [\r\n] -> skip;
ws : WS+;
-WORD : ALPHABET+;
-
+WORD : ALPHABET* ALPHA ALPHABET*; // needs to have at least one alphabetical letter
/*
* Regular expressions
@@ -76,7 +79,7 @@
;
date
-: DIGIT DIGIT DIGIT DIGIT (DASH DIGIT DIGIT (DASH DIGIT DIGIT)?)?
+: DATE
;
operator
@@ -110,7 +113,6 @@
key
: WORD
| regex
-| NUMBER
;
foundry
@@ -136,10 +138,9 @@
;
value
-: WORD
-| NUMBER
-| date
+: WORD
| '"' (WORD ws*)+'"'
+| date
| regex
;