Description Usage Arguments Details Value See Also Examples
Pattern (or Pseudo) raw: Approximate Python-like 'raw' Strings (with warnings)
1 | praw1(pat, cesc = "`")
|
pat |
a string or character vector |
cesc |
a single character(default ') to be substituted by double \ in the pattern where any cescs appeared on input. Note this warns if 'cesc' is not a single character or if it is the special set: "([.|)\^+$*?:]" |
Literal occurrences of characters such as ([.|)\^+$*?:] often need to be escaped
in regular expression patterns. This makes them look very different than e.g. raw string patterns.
Thus, the equivalent of Python's
pyPat= r'\(\s*\w+\s*\)'
would have to look like:
rPat <- "\\(\\s*\\w+\\s*\\)".
With praw() we can instead use erPat <- ('`(`s*`w+`s*`)')
To match a literal single backslash in a string, pat <- praw('``', '`' ) is necessary, generating pat= '\\'.
the pattern with the 'cesc' character replaced by two backslashes. See details.
1 2 3 4 5 6 7 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.