Escaping metacharacters
- all of the metacharacters:
.^$\|*+?{}[]()
- to match a metacharacter you need to escape with
\
- regexes are represented by strings that also use
\
as escape symbol, so to escape a dot.
for example, you need to use"\\."
# To create the regular expression \., we need to use \\.
dot <- "\\."
# But the expression itself only contains one \
str_view(dot)
## [1] │ \.
## [2] │ <a.c>