► |  | The Racket Guide

1 | Welcome to Racket
2 | Racket 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 | Creating Languages
18 | Concurrency and Synchronization
19 | Performance
20 | Parallelism
21 | Running and Creating Executables
22 | More Libraries
23 | Dialects of Racket and Scheme
24 | Command-Line Tools and Your Editor of Choice
| Bibliography
| Index

▼ | 9 | Regular Expressions

9.1 | Writing Regexp Patterns
9.2 | Matching Regexp Patterns
9.3 | Basic Assertions
9.4 | Characters and Character Classes
9.5 | Quantifiers
9.6 | Clusters
9.7 | Alternation
9.8 | Backtracking
9.9 | Looking Ahead and Behind
9.10 | An Extended Example

top ← prev up next →

### 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.

top ← prev up next →