Description Usage Arguments Value Examples
View source: R/fixed_to_regexp.R
A back slash (\
) is added before special symbols
(. \ | ( ) [ { }^ $ * + ?
) in a string str
to interpret them as "fixed" in a regular expression.
Useful in functions, which accept regular expressions but do not have
option fixed = TRUE
.
1 |
str |
A string |
The string rewritten as regular expression.
1 2 3 4 5 6 7 8 9 10 11 | fixed_to_regexp("\\")
## "\\"
fixed_to_regexp("||")
fixed_to_regexp(".\\|(){}^$*+?[]")
fixed_to_regexp("(A|B)")
## "\(A\|B\)"
fixed_to_regexp("Hello!") # nothing is changed
## "Hello!"
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.