Skip to content

Commit

Permalink
Mention quantifier term
Browse files Browse the repository at this point in the history
  • Loading branch information
hadley committed Apr 18, 2021
1 parent 3abea6b commit 47585ee
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion strings.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ str_view(c("grey", "gray"), "gr(e|a)y")

5. Create a regular expression that will match telephone numbers as commonly written in your country.

### Repetition
### Repetition / Quantifiers

The next step up in power involves controlling how many times a pattern matches:

Expand Down Expand Up @@ -414,6 +414,8 @@ str_view(x, 'C{2,3}?')
str_view(x, 'C[LX]+?')
```

Collectively, these operators are called **quantifiers** because they quantify how many times a match can occur.

#### Exercises

1. Describe the equivalents of `?`, `+`, `*` in `{m,n}` form.
Expand Down

0 comments on commit 47585ee

Please sign in to comment.