🔍 An RStudio addin slash regex utility belt
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

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