diff options
author | William Carroll <wpcarro@gmail.com> | 2020-11-13T16·55+0000 |
---|---|---|
committer | William Carroll <wpcarro@gmail.com> | 2020-11-13T16·55+0000 |
commit | 14f6169fcf5c34455c21ca80850eeb5652a85e4a (patch) | |
tree | cc903d37d905a8a6ac53f8dc6bcb0ee627b0e5ea /scratch/facebook/parsing/regex.py | |
parent | aa66d9b83d5793bdbb7fe28368e0642f7c3dceac (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.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/scratch/facebook/parsing/regex.py b/scratch/facebook/parsing/regex.py index e0757e1f788f..7fc2ef34e2ff 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 |