Installation
Quick Take
Examples
Purpose
This program converts the regex matches into ranges array so that continue to use the Ranges workflow — process the string in composable fashion — gather many pending string amendment operations, reason about them, process them, and finally, in the end, “render” ranges into the result string and do it only once.
API — rRegex()
The main function rRegex()
is imported like this:
It’s a function which takes three input arguments:
This package does not mutate its inputs.
Input argument | Type | Obligatory | Description |
---|---|---|---|
regx Type: Regular expression Obligatory: yes | |||
regx | Regular expression | yes | Provide the regexp to apply onto a string |
str Type: String Obligatory: yes | |||
str | String | yes | Provide a string upon which to match the regex |
replacement Type: String or null Obligatory: no | |||
replacement | String or null | no | If you want to add a third argument on every of the finding’s third argument values, put it here. |
Function will return ranges — a null
(theoretically possible) or array of one or more range arrays:
Tip: You can use all the features of regexes: global, case insensitive flags and so on.
API — version
You can import version
: