Build a standard Pattern Access a library of pre-defined, complex regex patterns for common data types.

xp_build_standard(type)

Arguments

type

A character string specifying the pattern. Options include: "email", "phone", "zip", "date_iso", "date_us", "credit_card", "ipv4", "hex_color", "time_24", "ssn", "mac_address".

Value

A regexpert object.

Examples

xp_build_standard("email")
#> <regexpert pattern>
#>   [a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}
xp_build_standard("zip") %>% xp_action_find("My code is 83440")
#> [1] "83440"