Matches a digit-only needle inside a digit-only haystack.
If needle has at least min_partial digits, partial matching is allowed.
Otherwise, only exact matches are considered.
Usage
whapi_match_digits(haystack, needle, min_partial = 6)
Arguments
- haystack
String with potential digits to search in.
- needle
String with digits to search for.
- min_partial
Minimum number of digits required to allow partial match.
Value
Logical (TRUE/FALSE) indicating whether a match was found.
Examples
whapi_match_digits("tel: 81998765432", "987654")
#> [1] TRUE
#> TRUE
whapi_match_digits("12345", "123", min_partial = 4)
#> [1] FALSE
#> FALSE