🔍 An RStudio addin slash regex utility belt
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

57 linhas
1.9KB

  1. % Generated by roxygen2: do not edit by hand
  2. % Please edit documentation in R/regex.R
  3. \name{view_regex}
  4. \alias{view_regex}
  5. \title{View grouped regex results}
  6. \usage{
  7. view_regex(
  8. text,
  9. pattern,
  10. ...,
  11. render = TRUE,
  12. escape = render,
  13. exact = escape,
  14. result_only = FALSE
  15. )
  16. }
  17. \arguments{
  18. \item{text}{Text to search}
  19. \item{pattern}{Regex pattern to look for}
  20. \item{...}{
  21. Arguments passed on to \code{\link[base:grep]{base::regexec}}
  22. \describe{
  23. \item{\code{ignore.case}}{if \code{FALSE}, the pattern matching is \emph{case
  24. sensitive} and if \code{TRUE}, case is ignored during matching.}
  25. \item{\code{perl}}{logical. Should Perl-compatible regexps be used?}
  26. \item{\code{fixed}}{logical. If \code{TRUE}, \code{pattern} is a string to be
  27. matched as is. Overrides all conflicting arguments.}
  28. \item{\code{useBytes}}{logical. If \code{TRUE} the matching is done
  29. byte-by-byte rather than character-by-character. See
  30. \sQuote{Details}.}
  31. }}
  32. \item{render}{Render results as HTML?}
  33. \item{escape}{Escape HTML-related characters in \code{text}?}
  34. \item{exact}{Should the regex pattern be displayed as entered by the user
  35. into R console or source (default)? When \code{TRUE}, regex is displayed with
  36. the double \verb{\\\\\\\\} required for escaping backslashes in R. When \code{FALSE},
  37. regex is displayed as interpreted by the regex engine (i.e. double \verb{\\\\\\\\}
  38. as a single \verb{\\\\}).}
  39. \item{result_only}{Should only the result be displayed? If \code{FALSE}, then
  40. the colorized regular expression is also displayed in the output.}
  41. }
  42. \description{
  43. View the result of the regular expression when applied to the given text.
  44. The default behavior renders the result as HTML and opens the file in
  45. the RStudio viewer pane. If \code{render} is \code{FALSE}, the HTML itself is returned.
  46. If the output is destined for a \link{knitr} document, set \code{knitr} to \code{TRUE}.
  47. }
  48. \examples{
  49. view_regex("example", "amp", render = FALSE)
  50. }