3 Match and Range
A range expression is specified as char1 - char2, where all characters between the first and second character are considered, inclusively. A match expression is a set of characters, ranges, where any member of the set matches.
value
value
char>=/c : contract?
> (rx/range #\A #\F) "A-F"
> (rx/range #\F #\A) to-char: contract violation
expected: char>=? #\F
given: #\A
> (rx/ranges '(#\A . #\F) '(#\F . #\A)) "A-FF-A"
value
procedure
(rx/not-match expr ...) → string?
expr : string?
procedure
expr : string?
> (rx/not-match "a" "b" "cd") "[^abcd]"
> (rx/^match "a" "b" "cd") "[^abcd]"
procedure
(rx/not-match? expr) → boolean?
expr : string?
procedure
(rx/match-range from to) → string?
from : char? to : char?
> (rx/match-range #\x #\z) "[x-z]"
> ((compose rx/match rx/range) #\x #\z) "[x-z]"
procedure
(rx/not-match-range from to) → string?
from : char? to : char?
procedure
(rx/^match-range from to) → string?
from : char? to : char?
> (rx/not-match-range #\g #\p) rx/not-match-range: undefined;
cannot reference an identifier before its definition
in module: top-level
> (rx/^match-range #\g #\p) "[^g-p]"
> (rx/escape "-") "\\-"
> (rx/escape "|") "|"
> (rx/escape "-" 'outside-match) "-"
> (rx/escape "|" 'outside-match) "\\|"
3.1 Named Ranges
value
value
value
value
value
value
value
value
value
value
value
value
value
value