9 Regular Expressions🔗ℹ

This chapter is a modified version of [Sitaram05].

A regexp value encapsulates a pattern that is described by a string or byte string. The regexp matcher tries to match this pattern against (a portion of) another string or byte string, which we will call the text string, when you call functions like regexp-match. The text string is treated as raw text, and not as a pattern.

    9.1 Writing Regexp Patterns

    9.2 Matching Regexp Patterns

    9.3 Basic Assertions

    9.4 Characters and Character Classes

      9.4.1 Some Frequently Used Character Classes

      9.4.2 POSIX character classes

    9.5 Quantifiers

    9.6 Clusters

      9.6.1 Backreferences

      9.6.2 Non-capturing Clusters

      9.6.3 Cloisters

    9.7 Alternation

    9.8 Backtracking

    9.9 Looking Ahead and Behind

      9.9.1 Lookahead

      9.9.2 Lookbehind

    9.10 An Extended Example

+Regular Expressions in The Racket Reference provides more on regexps.