Learn R Programming

whapi (version 0.0.2)

whapi_match_digits: Digit matching helper (with partial threshold)

Description

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)

Value

Logical (TRUE/FALSE) indicating whether a match was found.

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.

Examples

Run this code
whapi_match_digits("tel: 81998765432", "987654")
#> TRUE
whapi_match_digits("12345", "123", min_partial = 4)
#> FALSE

Run the code above in your browser using DataLab