Description Usage Format Details Note Source
A regex pattern to identify natural language English number phrases, such as
"one hundred and fifty" or "thirty-seven". Used internally by
replace_numbers
to identify substrings to replace with their
decimal representation.
1 |
An object of class character
of length 1.
This is a PCRE (Perl type) regular expression, so it must be used with
perl = TRUE
in base R regex functions. The packages stringr
and stringi
are based on the alternative ICU regular expression
engine, so they cannot use this pattern.
There is limited support for fractional expressions like "one half". The original pattern did not support expressions like "a thousand", but it has been adapted to offer (experimental) support for this. Phrases like "million" or "thousand" with no prefix will not match.
https://www.rexegg.com/regex-trick-numbers-in-english.html
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.