Special character classes
Commonly used character classes with their own shortcut:
\.
matches any character apart from a newline.\d
matches any digit.\D
matches anything that isn’t a digit.\s
matches any whitespace (e.g., space, tab, newline).\S
matches anything that isn’t whitespace.\w
matches any “word” character, i.e. letters and numbers.\W
matches any “non-word” character.
## [1] │ abcd ABCD <12345> -!@#%.
## [1] │ <abcd ABCD >12345< -!@#%.>
## [1] │ abcd< >ABCD< >12345< >-!@#%.
## [1] │ <abcd> <ABCD> <12345> <-!@#%.>
## [1] │ <abcd> <ABCD> <12345> -!@#%.
## [1] │ abcd< >ABCD< >12345< -!@#%.>