6 Grouping
value
group-repeat/c : contract?
procedure
expr : string?
procedure
expr : string? repeat : group-repeat/c = 'one
procedure
(rx/and-group expr ...+ [#:repeat repeat]) → string?
expr : string? repeat : group-repeat/c = 'one
> (rx/and-group "cat" "dog") "(catdog)"
> (rx/and-group "cat" "dog" #:repeat 'optional) "(catdog)?"
procedure
(rx/or-group expr ...+ [#:repeat repeat]) → string?
expr : string? repeat : group-repeat/c = 'one
> (rx/or-group "cat" "dog") "(cat|dog)"
> (rx/or-group "cat" "dog" #:repeat 'optional) "(cat|dog)?"
procedure
(rx/special-group? expr) → boolean?
expr : string?
> (rx/special-group? (rx/group "cat")) #f
> (rx/special-group? (rx/non-capture-group "cat")) rx/non-capture-group: contract violation
received: 1 argument
expected: at least 2 non-keyword arguments
in: (->*
((or/c string? symbol? char?)
(or/c string? symbol? char?))
(#:repeat
(or/c
'one
'optional
'zero-or-more
'one-or-more))
#:rest
(listof (or/c string? symbol? char?))
string?)
contract from: <pkgs>/rx/main.rkt
blaming: top-level
(assuming the contract is correct)
at: <pkgs>/rx/main.rkt:80:11
procedure
(rx/non-capture-group? expr) → boolean?
expr : string?
procedure
(rx/non-capture-group expr ...+ [ #:repeat repeat]) → string? expr : string? repeat : group-repeat/c = 'one
procedure
(rx/nc-group expr ...+ [#:repeat repeat]) → string?
expr : string? repeat : group-repeat/c = 'one
> (rx/non-capture-group "cat") rx/non-capture-group: contract violation
received: 1 argument
expected: at least 2 non-keyword arguments
in: (->*
((or/c string? symbol? char?)
(or/c string? symbol? char?))
(#:repeat
(or/c
'one
'optional
'zero-or-more
'one-or-more))
#:rest
(listof (or/c string? symbol? char?))
string?)
contract from: <pkgs>/rx/main.rkt
blaming: top-level
(assuming the contract is correct)
at: <pkgs>/rx/main.rkt:80:11
> (rx/non-capture-group "cat" #:repeat 'optional) rx/non-capture-group: contract violation
received: 1 argument
expected: at least 2 non-keyword arguments
in: (->*
((or/c string? symbol? char?)
(or/c string? symbol? char?))
(#:repeat
(or/c
'one
'optional
'zero-or-more
'one-or-more))
#:rest
(listof (or/c string? symbol? char?))
string?)
contract from: <pkgs>/rx/main.rkt
blaming: top-level
(assuming the contract is correct)
at: <pkgs>/rx/main.rkt:80:11
> (rx/non-capture-group? (rx/non-capture-group "cat")) rx/non-capture-group: contract violation
received: 1 argument
expected: at least 2 non-keyword arguments
in: (->*
((or/c string? symbol? char?)
(or/c string? symbol? char?))
(#:repeat
(or/c
'one
'optional
'zero-or-more
'one-or-more))
#:rest
(listof (or/c string? symbol? char?))
string?)
contract from: <pkgs>/rx/main.rkt
blaming: top-level
(assuming the contract is correct)
at: <pkgs>/rx/main.rkt:80:11
procedure
(rx/named-group? expr) → boolean?
expr : string?
procedure
(rx/named-group expr ...+ #:name name [ #:repeat repeat]) → string? expr : string? name : string? repeat : group-repeat/c = 'one
> (rx/named-group (rx/or "cat" "dog") #:name "animal") rx/named-group: contract violation
received: 1 argument
expected: at least 2 non-keyword arguments
in: (->*
((or/c string? symbol? char?)
(or/c string? symbol? char?)
#:name
(or/c string? symbol? char?))
(#:repeat
(or/c
'one
'optional
'zero-or-more
'one-or-more))
#:rest
(listof (or/c string? symbol? char?))
string?)
contract from: <pkgs>/rx/main.rkt
blaming: top-level
(assuming the contract is correct)
at: <pkgs>/rx/main.rkt:74:11
> (rx/named-group (rx/or "cat" "dog") #:name "animal" #:repeat 'optional) rx/named-group: contract violation
received: 1 argument
expected: at least 2 non-keyword arguments
in: (->*
((or/c string? symbol? char?)
(or/c string? symbol? char?)
#:name
(or/c string? symbol? char?))
(#:repeat
(or/c
'one
'optional
'zero-or-more
'one-or-more))
#:rest
(listof (or/c string? symbol? char?))
string?)
contract from: <pkgs>/rx/main.rkt
blaming: top-level
(assuming the contract is correct)
at: <pkgs>/rx/main.rkt:74:11
> (rx/named-group? (rx/named-group (rx/or "cat" "dog") #:name "animal")) rx/named-group: contract violation
received: 1 argument
expected: at least 2 non-keyword arguments
in: (->*
((or/c string? symbol? char?)
(or/c string? symbol? char?)
#:name
(or/c string? symbol? char?))
(#:repeat
(or/c
'one
'optional
'zero-or-more
'one-or-more))
#:rest
(listof (or/c string? symbol? char?))
string?)
contract from: <pkgs>/rx/main.rkt
blaming: top-level
(assuming the contract is correct)
at: <pkgs>/rx/main.rkt:74:11
> (rx/special-group? (rx/named-group (rx/or "cat" "dog") #:name "animal")) rx/named-group: contract violation
received: 1 argument
expected: at least 2 non-keyword arguments
in: (->*
((or/c string? symbol? char?)
(or/c string? symbol? char?)
#:name
(or/c string? symbol? char?))
(#:repeat
(or/c
'one
'optional
'zero-or-more
'one-or-more))
#:rest
(listof (or/c string? symbol? char?))
string?)
contract from: <pkgs>/rx/main.rkt
blaming: top-level
(assuming the contract is correct)
at: <pkgs>/rx/main.rkt:74:11
6.1 Modes
value
mode/c : contract?
procedure
(rx/with-mode expr ...+ #:mode modes) → string?
expr : string? modes : (or/c mode/c (listof mode/c))
> (rx/with-mode (rx/or "cat" "dog") #:mode 'case-insensitive) "(?i:cat|dog)"