From 2ee3426457617d4d395b25d8d3668195e2b8c4d4 Mon Sep 17 00:00:00 2001 From: vanderlindenma Date: Wed, 14 Apr 2021 11:43:36 -0400 Subject: [PATCH] str_view(), repetition at most n times yields error #807, and small typos in "Iteration chapter" (#808) * Update and rename strings.Rmd to strings.Rmd Proposed fix related to this issue: https://github.com/hadley/r4ds/issues/807 A more comprehensive fix should perhaps discuss why "`{,m}`: at most m" does not work (or warn the reader that it does not) * Typos in iteration.Rmd Correcting two small typos * Add missing word * Add code example for 1,m Co-authored-by: Mine Cetinkaya-Rundel --- strings.Rmd | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/strings.Rmd b/strings.Rmd index 5fef7b6..77dc712 100644 --- a/strings.Rmd +++ b/strings.Rmd @@ -395,12 +395,13 @@ You can also specify the number of matches precisely: - `{n}`: exactly n - `{n,}`: n or more -- `{,m}`: at most m +- `{1,m}`: at most m - `{n,m}`: between n and m ```{r} str_view(x, "C{2}") str_view(x, "C{2,}") +str_view(x, "C{1,3}") str_view(x, "C{2,3}") ```