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:
S'busiso Mkhondwane 2016-08-15 14:32:32 +02:00 committed by Hadley Wickham
parent b0d830b181
commit 6c5eb2a452
1 changed files with 3 additions and 3 deletions

View File

@ -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.)