about summary refs log tree commit diff
path: root/scratch/facebook/parsing/regex.py
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2020-11-13T16·55+0000
committerWilliam Carroll <wpcarro@gmail.com>2020-11-13T16·55+0000
commit14f6169fcf5c34455c21ca80850eeb5652a85e4a (patch)
treecc903d37d905a8a6ac53f8dc6bcb0ee627b0e5ea /scratch/facebook/parsing/regex.py
parentaa66d9b83d5793bdbb7fe28368e0642f7c3dceac (diff)
Document subset of BNF for regex engine
Adding some documentation for my future self.
Diffstat (limited to 'scratch/facebook/parsing/regex.py')
-rw-r--r--scratch/facebook/parsing/regex.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/scratch/facebook/parsing/regex.py b/scratch/facebook/parsing/regex.py
index e0757e1f78..7fc2ef34e2 100644
--- a/scratch/facebook/parsing/regex.py
+++ b/scratch/facebook/parsing/regex.py
@@ -3,6 +3,16 @@
 #   - parser
 #   - compiler
 # ...for regex.
+#
+# BNF
+# expression -> ( char_class | CHAR ) quantifier? ( "|" expression )*
+# char_class -> "[" CHAR+ "]"
+# quantifier -> "?" | "*" | "+" | "{" INT? "," INT? "}"
+#
+# Of the numerous things I do not support, here are a few items of which I'm
+# aware:
+#   - alternatives:   (a|b)
+#   - capture groups: (ab)cd
 
 from parser import Parser
 import string