@@ -10,7 +10,7 @@ Status: Active – The project has reached a stable, usable state and is
10
10
being actively
11
11
developed.] ( http://www.repostatus.org/badges/latest/active.svg )] ( http://www.repostatus.org/#active )
12
12
[ ![ CRAN\_ Status\_ Badge] ( http://www.r-pkg.org/badges/version/regexplain )] ( https://cran.r-project.org/package=regexplain )
13
- <!-- [](/commits/master) -->
13
+ <!-- [](/commits/master) -->
14
14
15
15
<!-- Links -->
16
16
@@ -23,16 +23,13 @@ Inspired by [RegExr.com](https://regexr.com/) and `stringr::str_view()`.
23
23
24
24
## Installation
25
25
26
- Installation is easy with ` devtools `
26
+ Installation is easy with ` remotes `
27
27
28
28
``` r
29
- devtools :: install_github(" gadenbuie/regexplain" )
29
+ # install.packages("remotes")
30
+ remotes :: install_github(" gadenbuie/regexplain" )
30
31
```
31
32
32
- or for hands-free installation
33
-
34
- source("https://install-github.me/gadenbuie/regexplain")
35
-
36
33
## RegExplain in Action
37
34
38
35
#### Overview
@@ -55,11 +52,18 @@ examples](https://raw.githubusercontent.com/gadenbuie/regexplain/af4fe0988a10f34
55
52
The main feature of this package is the RStudio Addin ** RegExplain
56
53
Selection** . Just select the text or object containing text (such as the
57
54
variable name of a vector or a data.frame column) and run ** RegExplain
58
- Selection** from the RStudio Addins
59
- dropdown.
55
+ Selection** from the RStudio Addins dropdown.
60
56
61
57
<img src =" docs/rstudio-addin-list.png " width = " 250px; " alt =" regexplain in the Rstudio Addins dropdown " >
62
58
59
+ You can also open the addin with ` regexplain_gadget() ` . This allows you
60
+ to pass text or a regular expression to the gadget, which is useful when
61
+ you want to work with a regular expression in your code or environment.
62
+
63
+ ``` r
64
+ regexplain_gadget(text_vector , " \\ b(red|blue|green): \\ d{3}" )
65
+ ```
66
+
63
67
The addin will open an interface with 4 panes where you can
64
68
65
69
- edit the ** text** you’ve imported
@@ -72,8 +76,7 @@ The addin will open an interface with 4 panes where you can
72
76
![ The panes of regexplain] ( docs/regexplain-gadget-tabs.png )
73
77
74
78
When you’re done, click on the ** Send Regex to Console** to send your
75
- regex expression to… the
76
- console\!
79
+ regex expression to… the console\!
77
80
78
81
``` r
79
82
> pattern <- " \\ b(red|orange|yellow|green|blue|purple|white|brown)(?:\\ s(\\ w+))?"
@@ -120,8 +123,7 @@ patterns.
120
123
121
124
The full library is stored as a JSON file in
122
125
[ inst/extdata/patterns.json] ( /inst/extdata/patterns.json ) , feel free to
123
- contribute patterns you find useful or use regularly via pull
124
- request.
126
+ contribute patterns you find useful or use regularly via pull request.
125
127
126
128
<img src =" docs/regexplain-gadget-library.png " height =" 400px " alt =" regexplain library modal " >
127
129
0 commit comments