diff --git a/strings.Rmd b/strings.Rmd index 4a321d5..76e4b3b 100644 --- a/strings.Rmd +++ b/strings.Rmd @@ -366,7 +366,7 @@ str_view(x, 'C[LX]+?') 1. `"\\{.+\\}"` 1. `\d{4}-\d{2}-\d{2}` 1. `"\\\\{4}"` - + 1. Create regular expressions to find all words that: 1. Start with three consonants. @@ -378,7 +378,7 @@ str_view(x, 'C[LX]+?') ### Grouping and backreferences -Earlier, you learned about parentheses as a way to disambiguate complex expressions. They also definie "groups" that you can refer to with _backreferences_, like `\1`, `\2` etc. For example, the following regular expression finds all fruits that have a repeated pair of letters. +Earlier, you learned about parentheses as a way to disambiguate complex expressions. They also define "groups" that you can refer to with _backreferences_, like `\1`, `\2` etc. For example, the following regular expression finds all fruits that have a repeated pair of letters. ```{r} str_view(fruit, "(..)\\1", match = TRUE) @@ -401,7 +401,7 @@ str_view(fruit, "(..)\\1", match = TRUE) 1. Start and end with the same character. 1. Contain a repeated pair of letters - (e.g. "church" contains "ch" repeated twice) + (e.g. "church" contains "ch" repeated twice.) 1. Contain one letter repeated in at least three places (e.g. "eleven" contains three "e"s.)