1 Welcome to PLT Scheme
2 Scheme Essentials
3 Built-In Datatypes
4 Expressions and Definitions
5 Programmer-Defined Datatypes
6 Modules
7 Contracts
8 Input and Output
9 Regular Expressions
10 Exceptions and Control
11 Iterations and Comprehensions
12 Pattern Matching
13 Classes and Objects
14 Units (Components)
15 Reflection and Dynamic Evaluation
16 Macros
17 Performance
18 Running and Creating Executables
19 Compilation and Configuration
20 More Libraries
Bibliography
Index
Version: 4.0.2

 

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 Reference: PLT Scheme provides more on regexps.