🔍 An RStudio addin slash regex utility belt
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
Garrick Aden-Buie 2780a0c73b Clean up a bit for devtools::check() před 8 roky
R Clean up a bit for devtools::check() před 8 roky
data-raw Update cheatsheet před 8 roky
docs Fix nested groups calculation and add example to Readme před 8 roky
inst Add regexplain_file addin and set all as interactive před 8 roky
man Clean up a bit for devtools::check() před 8 roky
tests Update regex_gadget and add Rstudio add-in před 8 roky
.Rbuildignore Initial commit před 8 roky
.gitignore Initial commit před 8 roky
DESCRIPTION Clean up a bit for devtools::check() před 8 roky
LICENSE.md Update regex_gadget and add Rstudio add-in před 8 roky
NAMESPACE Clean up a bit for devtools::check() před 8 roky
Readme.Rmd Fix nested groups calculation and add example to Readme před 8 roky
Readme.md Fix nested groups calculation and add example to Readme před 8 roky
regexplain.Rproj Rename to regexplain před 8 roky

Readme.md

regexplain

WORK IN PROGRESS!!

regexplain is going to be an RStudio addin that helps you interactively build up your regex. Inspired by RegExr and stringr::str_view.

Done (ish)

You can use view_regex() for a stringr::str_view() replacement that includes groups.

text <- c("breakfast=eggs;lunch=pizza",
          "breakfast=bacon;lunch=spaghetti", 
          "no food here")
pattern <- "((\\w+)=)(\\w+).+(ch=s?p)"

view_regex(text, pattern)
Example view_regex(text, pattern).
Example view_regex(text, pattern).
t_nested <- "anestedgroupwithingroupexample"
r_nested <- "(a(nested)(group(within(group))(example)))"
view_regex(t_nested, r_nested)
Example of nested groups
Example of nested groups

Planned (ish)

  1. An Rstudio addin gadget that allows you to interactively enter the regex and see the results. Like the above example, where the regex field is a text input.

  2. Import data from your environment, like a character vector, file, or data.frame column when opening the gadget.

  3. Help tab in the gadget, pulling from ?regex but with some navigation.

  4. Tab to interactively explore output of varying regex-applying functions. In other words, see what stringr::str_locate_all or stringr::str_match_all or grep or grepl return when applying the regex to your text.