On this page:
rx/  conditional
rx/  if
rx/  look-ahead
rx/  =>
rx/  not-look-ahead
rx/  !=>
rx/  look-behind
rx/  <=
rx/  not-look-behind
rx/  <!=
rx/  group-ref

7 Conditionals🔗ℹ

procedure

(rx/conditional test if-true [if-false])  string?

  test : string?
  if-true : string?
  if-false : (or/c string? #f) = #f

procedure

(rx/if test if-true [if-false])  string?

  test : string?
  if-true : string?
  if-false : (or/c string? #f) = #f
TBD

Example:
> '()

'()

procedure

(rx/look-ahead expr)  string?

  expr : string?

procedure

(rx/=> expr)  string?

  expr : string?
TBD

Example:
> '()

'()

procedure

(rx/not-look-ahead expr)  string?

  expr : string?

procedure

(rx/!=> expr)  string?

  expr : string?
TBD

Example:
> '()

'()

procedure

(rx/look-behind expr)  string?

  expr : string?

procedure

(rx/<= expr)  string?

  expr : string?
TBD

Example:
> '()

'()

procedure

(rx/not-look-behind expr)  string?

  expr : string?

procedure

(rx/<!= expr)  string?

  expr : string?
TBD

Example:
> '()

'()

procedure

(rx/group-ref n)  string?

  n : integer?
TBD

The type of n depends on the parameter rx/has-relative-group-refs; if #t the type allows negative and positive values, otherwise it only allows positive.

The form of a group reference depends on the value of the parameter rx/group-ref-form.

Examples:
> (parameterize ((rx/group-ref-form 'grouped))
    (rx/group-ref 1))

"(1)"

> (parameterize ((rx/group-ref-form 'escaped))
    (rx/group-ref 1))

"\\1"

> (parameterize ((rx/group-ref-form 'grouped))
    (rx/conditional (rx/group-ref 1) "-bird" "bird"))

"(?(1)-bird|bird)"

> (parameterize ((rx/group-ref-form 'escaped))
    (rx/conditional (rx/group-ref 1) "-bird" "bird"))

"(?\\1-bird|bird)"