regular‑expression | → | alternative |
alternative | → | catenation (| catenation)* |
catenation | → | repetition repetition* |
repetition | → | primary (* | + | ?)? |
primary | → | ( alternative ) | escape | ^ | - | [^\0\r\n{}\\()[]|*+?.^-] | . | class | expression‑reference |
class | → | [ (^? range*) ] |
range | → | char (- char | <empty>) |
char | → | ( | ) | [ | { | } | | | * | + | ? | . | escape | ^ | - | [^\0\r\n{}\\()[]|*+?.^-] |
expression‑reference | → | { [^\0\r\n{}\\()[]|*+?.^-]+ } |