| ## regexplain 0.2 | |||||
| ## regexplain 0.2.x | |||||
| * Added "Templates" button that opens a dialog to import regex patterns | |||||
| (initially) sourced from <https://projects.lukehaas.me/regexhub>. | |||||
| ### 0.2.0 | |||||
| * Added "Library" button that opens a dialog to import regex patterns sourced | |||||
| from <https://projects.lukehaas.me/regexhub> and | |||||
| <https://github.com/trinker/qdapRegex>. The library is stored in | |||||
| `inst/extdata/patterns.json`. | |||||
| * Added "Introduction", "Try These Examples" and "Resources" tabs to | * Added "Introduction", "Try These Examples" and "Resources" tabs to | ||||
| the standard gadget Help tab. | the standard gadget Help tab. | ||||
| * Several bugfixes and tests were added around unicode character escaping within | * Several bugfixes and tests were added around unicode character escaping within | ||||
| * Enable `perl` mode by default in gadget (consistent with `stringr` and most | * Enable `perl` mode by default in gadget (consistent with `stringr` and most | ||||
| regexes in the wild, but not base R). Write out selected options as comments | regexes in the wild, but not base R). Write out selected options as comments | ||||
| when not consistent with base R when returning pattern from gadget. | when not consistent with base R when returning pattern from gadget. | ||||
| * Rewrote Readme with new screenshots and screencasts. | |||||
| * Added options `regexplain.addin.max_lines` and options for debugging gadget inputs. | |||||
| ## regexplain 0.1.x | ## regexplain 0.1.x | ||||
| #### *Regular expressions are tricky.* RegExplain *makes it easier to see what you're doing.* | #### *Regular expressions are tricky.* RegExplain *makes it easier to see what you're doing.* | ||||
| <!-- [](commits/master) --> | <!-- [](commits/master) --> | ||||
|  | |||||
|  | |||||
| [](http://www.repostatus.org/#active) | [](http://www.repostatus.org/#active) | ||||
| [](https://cran.r-project.org/package=regexplain) | [](https://cran.r-project.org/package=regexplain) | ||||
| <!-- [)`-yellowgreen.svg)](/commits/master) --> | <!-- [)`-yellowgreen.svg)](/commits/master) --> | ||||
| <!-- Links --> | <!-- Links --> | ||||
| [regexr]: https://regexr.com/ | [regexr]: https://regexr.com/ | ||||
| **RegExplain** is an RStudio addin that helps you interactively build up your regular expressions. | |||||
| **RegExplain** is an RStudio addin slash utility belt for regular expressions. | |||||
| Interactively build your regexp, check the output of common string matching functions, consult the interactive help pages, or use the included resources to learn regular expressions. | |||||
| And more. | |||||
| Inspired by [RegExr.com][regexr] and `stringr::str_view()`. | Inspired by [RegExr.com][regexr] and `stringr::str_view()`. | ||||
| ## Installation | ## Installation | ||||
|  |  | ||||
| ## R Studio Addin | |||||
| ## RStudio Addin | |||||
| The main feature of this package is the R Studio Addin **RegExplain Selection**. | |||||
| The main feature of this package is the RStudio Addin **RegExplain Selection**. | |||||
| Just select the text or object containing text (such as the variable name of a vector or a data.frame column) and run **RegExplain Selection** from the RStudio Addins dropdown. | Just select the text or object containing text (such as the variable name of a vector or a data.frame column) and run **RegExplain Selection** from the RStudio Addins dropdown. | ||||
| <img src="docs/rstudio-addin-list.png" width = "250px;" alt="regexplain in the Rstudio Addins dropdown"> | <img src="docs/rstudio-addin-list.png" width = "250px;" alt="regexplain in the Rstudio Addins dropdown"> | ||||
|  |  | ||||
| Open **RegExplain Cheatsheet** from the R Studio Addins drop down to open the regex reference page in the Viewer pane without blocking your current R session. | |||||
| Open **RegExplain Cheatsheet** from the RStudio Addins drop down to open the regex reference page in the Viewer pane without blocking your current R session. | |||||
| ### Import Your Text | ### Import Your Text | ||||
| There are two ways to get your text into *RegExplain*. | There are two ways to get your text into *RegExplain*. | ||||
| The first way was described above: select an object name or lines of text or code in the R Studio source pane and run **RegExplain Selection**. | |||||
| The first way was described above: select an object name or lines of text or code in the RStudio source pane and run **RegExplain Selection**. | |||||
| To import text from a file, use **RegExplain File** to you import the text you want to process with regular expressions. | To import text from a file, use **RegExplain File** to you import the text you want to process with regular expressions. | ||||
| When importing text, _RegExplain_ automatically reduces the text to the unique entries and limits the number of lines. | When importing text, _RegExplain_ automatically reduces the text to the unique entries and limits the number of lines. | ||||
| ### Regular Expressions Library | ### Regular Expressions Library | ||||
| The _RegExplain_ gadget also includes a regular expressions library in the **RegEx** tab. | |||||
| The _RegExplain_ gadget includes a regular expressions library in the **RegEx** tab. | |||||
| The library features common regular expressions, sourced from [qdapRegex](https://github.com/trinker/qdapRegex) and [Regex Hub](https://projects.lukehaas.me/regexhub), with several additional patterns. | The library features common regular expressions, sourced from [qdapRegex](https://github.com/trinker/qdapRegex) and [Regex Hub](https://projects.lukehaas.me/regexhub), with several additional patterns. | ||||
| The full library is stored as a JSON file in [inst/extdata/patterns.json](/inst/extdata/patterns.json), feel free to contribute patterns you find useful or use regularly via pull request. | The full library is stored as a JSON file in [inst/extdata/patterns.json](/inst/extdata/patterns.json), feel free to contribute patterns you find useful or use regularly via pull request. | ||||
| ## View Static Regex Results | ## View Static Regex Results | ||||
| _RegExplain_ also provides the function `view_regex()` that you can use as a `stringr::str_view()` replacement. | |||||
| _RegExplain_ provides the function `view_regex()` that you can use as a `stringr::str_view()` replacement. | |||||
| In addition to highlighting matched portions of the text, `view_regex()` colorizes groups and attempts to colorize the regex expression itself as well. | In addition to highlighting matched portions of the text, `view_regex()` colorizes groups and attempts to colorize the regex expression itself as well. | ||||
| ```r | ```r |
| <!-- [](commits/master) --> | <!-- [](commits/master) --> | ||||
|  [ [](http://www.repostatus.org/#active) | developed.](http://www.repostatus.org/badges/latest/active.svg)](http://www.repostatus.org/#active) | ||||
| <!-- Links --> | <!-- Links --> | ||||
| **RegExplain** is an RStudio addin that helps you interactively build up | |||||
| your regular expressions. Inspired by [RegExr.com](https://regexr.com/) | |||||
| and `stringr::str_view()`. | |||||
| **RegExplain** is an RStudio addin slash utility belt for regular | |||||
| expressions. Interactively build your regexp, check the output of common | |||||
| string matching functions, consult the interactive help pages, or use | |||||
| the included resources to learn regular expressions. And more. | |||||
| Inspired by [RegExr.com](https://regexr.com/) and `stringr::str_view()`. | |||||
| ## Installation | ## Installation | ||||
|  |  | ||||
| ## R Studio Addin | |||||
| ## RStudio Addin | |||||
| The main feature of this package is the R Studio Addin **RegExplain | |||||
| The main feature of this package is the RStudio Addin **RegExplain | |||||
| Selection**. Just select the text or object containing text (such as the | Selection**. Just select the text or object containing text (such as the | ||||
| variable name of a vector or a data.frame column) and run **RegExplain | variable name of a vector or a data.frame column) and run **RegExplain | ||||
| Selection** from the RStudio Addins | Selection** from the RStudio Addins | ||||
|  |  | ||||
| Open **RegExplain Cheatsheet** from the R Studio Addins drop down to | |||||
| open the regex reference page in the Viewer pane without blocking your | |||||
| Open **RegExplain Cheatsheet** from the RStudio Addins drop down to open | |||||
| the regex reference page in the Viewer pane without blocking your | |||||
| current R session. | current R session. | ||||
| ### Import Your Text | ### Import Your Text | ||||
| There are two ways to get your text into *RegExplain*. The first way was | There are two ways to get your text into *RegExplain*. The first way was | ||||
| described above: select an object name or lines of text or code in the R | |||||
| Studio source pane and run **RegExplain Selection**. To import text from | |||||
| a file, use **RegExplain File** to you import the text you want to | |||||
| described above: select an object name or lines of text or code in the | |||||
| RStudio source pane and run **RegExplain Selection**. To import text | |||||
| from a file, use **RegExplain File** to you import the text you want to | |||||
| process with regular expressions. | process with regular expressions. | ||||
| When importing text, *RegExplain* automatically reduces the text to the | When importing text, *RegExplain* automatically reduces the text to the | ||||
| ### Regular Expressions Library | ### Regular Expressions Library | ||||
| The *RegExplain* gadget also includes a regular expressions library in | |||||
| the **RegEx** tab. The library features common regular expressions, | |||||
| sourced from [qdapRegex](https://github.com/trinker/qdapRegex) and | |||||
| [Regex Hub](https://projects.lukehaas.me/regexhub), with several | |||||
| additional patterns. | |||||
| The *RegExplain* gadget includes a regular expressions library in the | |||||
| **RegEx** tab. The library features common regular expressions, sourced | |||||
| from [qdapRegex](https://github.com/trinker/qdapRegex) and [Regex | |||||
| Hub](https://projects.lukehaas.me/regexhub), with several additional | |||||
| patterns. | |||||
| The full library is stored as a JSON file in | The full library is stored as a JSON file in | ||||
| [inst/extdata/patterns.json](/inst/extdata/patterns.json), feel free to | [inst/extdata/patterns.json](/inst/extdata/patterns.json), feel free to | ||||
| ## View Static Regex Results | ## View Static Regex Results | ||||
| *RegExplain* also provides the function `view_regex()` that you can use | |||||
| as a `stringr::str_view()` replacement. In addition to highlighting | |||||
| matched portions of the text, `view_regex()` colorizes groups and | |||||
| attempts to colorize the regex expression itself as well. | |||||
| *RegExplain* provides the function `view_regex()` that you can use as a | |||||
| `stringr::str_view()` replacement. In addition to highlighting matched | |||||
| portions of the text, `view_regex()` colorizes groups and attempts to | |||||
| colorize the regex expression itself as well. | |||||
| ``` r | ``` r | ||||
| text <- c("breakfast=eggs;lunch=pizza", | text <- c("breakfast=eggs;lunch=pizza", |