Regular Expression Grammar

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