Description Usage Arguments Value Examples
Creates a regex from regex components.
1 | create_regex(..., l = list(), sep = "[- ]?")
|
... |
Character vectors of regex components. |
l |
A list of character vectors for alternate specification. |
sep |
Regex for separating components of complete regex. Defaults to "an optional space or hyphen". |
A string containing a regex.
Each element in the vectors are pasted together, separated by the
sep
value. Those character vectors are then preceded by "^"
(regex for 'start of string'() and followed by "$" (regex for end
of string). Finally, the regexes are collapsed with "|" (regex for
'or').
1 2 3 4 5 6 7 | ## Not run:
cas_number_components <- c(
"[[:digit:]]{1,7}", "[[:digit:]]{2}", "[[:digit:]]"
)
cas_number_rx <- create_regex(rx_components, sep = "-")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.