Description Usage Arguments Value Examples
Generates a regular expression that matches a sequence of numbers.
1 | number_range(lo, hi, allow_leading_zeroes = FALSE, capture = FALSE)
|
lo |
An integer. |
hi |
An integer greater than or equal to |
allow_leading_zeroes |
A logical value. Are leading zeroes allowed to bulk the match up to the length of the number with the most digits? |
capture |
A logical value. See |
A character vector representing part or all of a regular expression.
1 2 3 4 5 6 7 | number_range(0, 255)
number_range(0, 255, allow_leading_zeroes = TRUE)
number_range(10000, 19999)
number_range(6, 54321)
number_range(-77, 77)
number_range(-77, 77, capture = TRUE)
number_range(-77, 77, capture = NA)
|
<regex> (?:[0-1][0-9]{2}|2[0-4][0-9]|25[0-5])
<regex> (?:[0-1][0-9]{2}|2[0-4][0-9]|25[0-5])
<regex> (?:1[0-9]{4})
<regex> (?:[6-9]|[1-9][0-9]|[1-9][0-9]{2}|[1-9][0-9]{3}|[1-4][0-9]{4}|5[0-3][0-9]{3}|54[0-2][0-9]{2}|543[0-1][0-9]|5432[0-1])
<regex> (?:-(?:[1-9]|[1-6][0-9]|7[0-7])|(?:[0-6][0-9]|7[0-7]))
<regex> (-(?:[1-9]|[1-6][0-9]|7[0-7])|(?:[0-6][0-9]|7[0-7]))
<regex> -(?:[1-9]|[1-6][0-9]|7[0-7])|(?:[0-6][0-9]|7[0-7])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.