re_escape {re} | R Documentation |
re_escape
escapes all special characters in a string. This function is useful when you want to treat a
string literally in a regular expression context, escaping characters that would otherwise be interpreted as special
regex operators.
re_escape(pattern)
pattern |
A character vector where each element is a string in which special regex characters are to be escaped. |
A character vector of the same length as pattern
.
Python re.escape() documentation
re_escape("a[bc].*d?")
re_escape(".^$|*+?{}[]()")