-`"[:blank:]"` matches space and tab (not new line)
```{r}
expressions = c("abc ABC 123\t!?\\(){}\n")
str_extract_all(text7, "[:digit:]")
str_extract_all(text2, "[:alnum:]")
str_extract_all(text2, "[:lower:]")
str_extract_all(text6, "[:alpha:]")
```
### Alternates
Custom searches of strings
```{r}
# match A or B
# str_match(fruit, "apple|pear")
str_count(text3, "0|9")
# match one of
str_match_all(text3, "[09]")
# match anything but
str_extract_all(text6, "[^http://]")
# match a string between a range
str_extract_all(text4, "[Text - strings]")
```
### Quantifiers
```{r}
# match 0 or more
str_match_all(txt, "edit?")
str_match(folder, "2020?")
# match ZERO or more
str_match(text3, "8*")
# match exactly n times
str_match_all(text6, "w[2]")
# match n or more times
str_match_all(txt, "edit[2,]")
# match between n and m times
str_match_all(text3, "0[1,3]")
```
### Anchors !
This is the specialized part
```{r}
# match at start of string
str_count(folder, "^results")
# match at end of string
str_detect(folder, ".csv$")
```
In the folder vector is a list of csv files, to extract each of them properly need to use special formatting. In the pattern `\\d{n}` d is for digit and there are 3 digits after results and 4 digits after that. This is useful when running a `purrr` function.