diff --git a/strings.Rmd b/strings.Rmd index 75ba4c5..4f42585 100644 --- a/strings.Rmd +++ b/strings.Rmd @@ -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: @@ -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.