diff --git a/pydsl/Grammar/Definition.py b/pydsl/Grammar/Definition.py
index <HASH>..<HASH> 100644
--- a/pydsl/Grammar/Definition.py
+++ b/pydsl/Grammar/Definition.py
@@ -71,6 +71,9 @@ class RegularExpressionDefinition(GrammarDefinition):
         import re
         self.regexp = re.compile(regexp, flags)
 
+    def __hash__(self):
+        return hash(self.regexpstr)
+
     def __eq__(self, other):
         if not isinstance(other, RegularExpressionDefinition):
             return False
hash support for regexp grammars