# Regex syntax

regex
  `(regex` group `)`
group
  fragment* (`:as` `:a-name`)? ; capturing only when named
fragment
  `\character`
  `"string"`
  `{` (char char)* `}` ; char ranges, both ends inclusive
  `[` group `]`
  `#{` fragment* `}` ; alternative
  `a-symbol` ; must evaluate to a fragment
  `(some clojure code)` ; must evaluate to a fragment
  ; predefined helpers:
  `any` ; 1-character wildcard, aka .
  `(repeat` fragment `)` ; 0 to ∞
  `(repeat` fragment min `)` ; min to ∞
  `(repeat` fragment min max `)` ; min to max
  `(*` group `)` ; shorthand for (repeat [group])
  `(+` group `)` ; shorthand for (repeat [group] 1)
  `(?` group `)` ; shorthand for (repeat [group] 0 1)
char
  `\character`
  `a-symbol` ; must evaluate to a character
  `(some clojure code)` ; must evaluate to a character