regular‑expression | → | choice |
choice | → | catenation ( | catenation )* |
catenation | → | repetition ( repetition )* |
repetition | → | primary ( * | + | ? )? |
primary | → | ( choice ) | escape | class | expression‑reference | ^ | - | . | [^\x0\r\n{}\\()[\]|*+?.^-] |
class | → | [ ^? range* ] |
range | → | char (- char)? |
char | → | ( | ) | [ | ] | | | * | + | ? | . | escape | ^ | - | [^\x0\r\n{}\\()[\]|*+?.^-] |
expression‑reference | → | { expression‑name } |
expression‑name | → | [^\x0\r\n{}\\()[\]|*+?.^-]+ |