Previous: , Up: srfi regexps syntax   [Index]


2.39.7.9 Look around patterns

The following patterns are only supported if the feature ‘regexp-look-around’ is provided.

(look-ahead sre ...)

Zero–width look–ahead assertion. Asserts the sequence matches from the current position, without advancing the position.

(regexp-matches '(: "regular" (look-ahead " expression")
                    " expression")
                "regular expression")
⇒ #<regexp-match>

(regexp-matches '(: "regular" (look-ahead " ") "expression")
                    "regular expression")
⇒ #f
(look-behind sre ...)

Zero–width look–behind assertion. Asserts the sequence matches behind the current position, without advancing the position. It is an error if the sequence does not have a fixed length.

(neg-look-ahead sre ...)

Zero–width negative look–ahead assertion.

(neg-look-behind sre ...)

Zero–width negative look–behind assertion.