Update strings.Rmd (#263)
Typo. In some exercises there seem like the spacing between the numbering is not consistent. I tried to fix one here.
This commit is contained in:
parent
b0d830b181
commit
6c5eb2a452
|
@ -366,7 +366,7 @@ str_view(x, 'C[LX]+?')
|
||||||
1. `"\\{.+\\}"`
|
1. `"\\{.+\\}"`
|
||||||
1. `\d{4}-\d{2}-\d{2}`
|
1. `\d{4}-\d{2}-\d{2}`
|
||||||
1. `"\\\\{4}"`
|
1. `"\\\\{4}"`
|
||||||
|
|
||||||
1. Create regular expressions to find all words that:
|
1. Create regular expressions to find all words that:
|
||||||
|
|
||||||
1. Start with three consonants.
|
1. Start with three consonants.
|
||||||
|
@ -378,7 +378,7 @@ str_view(x, 'C[LX]+?')
|
||||||
|
|
||||||
### Grouping and backreferences
|
### 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}
|
```{r}
|
||||||
str_view(fruit, "(..)\\1", match = TRUE)
|
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. Start and end with the same character.
|
||||||
|
|
||||||
1. Contain a repeated pair of letters
|
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
|
1. Contain one letter repeated in at least three places
|
||||||
(e.g. "eleven" contains three "e"s.)
|
(e.g. "eleven" contains three "e"s.)
|
||||||
|
|
Loading…
Reference in New Issue