| Title: | Common String Format Validation |
|---|---|
| Description: | Validates common string formats including financial identifiers (ISIN, CUSIP, SEDOL, FIGI, IBAN, LEI), publication identifiers (ISBN, ISSN, DOI, ORCID), and general formats (email, UUID, URL, semver), with check digit verification where applicable. |
| Authors: | Maximilian Mücke [aut, cre] (ORCID: <https://orcid.org/0009-0000-9432-9795>) |
| Maintainer: | Maximilian Mücke <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.0.9000 |
| Built: | 2026-06-02 10:23:15 UTC |
| Source: | https://github.com/m-muecke/checkstring |
Assert that dots are empty
assert_empty_dots(...)assert_empty_dots(...)
... |
( |
NULL invisibly if empty, otherwise throws an error.
assert_empty_dots()assert_empty_dots()
Check if an argument is a base64 string
is_base64(x)is_base64(x)
x |
( |
TRUE if x is a valid base64 string, FALSE otherwise.
is_base64("SGVsbG8gV29ybGQ=")is_base64("SGVsbG8gV29ybGQ=")
Check if an argument is base64url string
is_base64url(x)is_base64url(x)
x |
( |
TRUE if x is a valid base64url string, FALSE otherwise.
is_base64url("SGVsbG8gV29ybGQ")is_base64url("SGVsbG8gV29ybGQ")
Check if an argument is a BIC/SWIFT code string
is_bic(x)is_bic(x)
x |
( |
TRUE if x is a valid BIC/SWIFT code string, FALSE otherwise.
https://en.wikipedia.org/wiki/ISO_9362 https://knowledge.xmldation.com/support/iso20022/general_rules/bic
is_bic("DEUTDEFF")is_bic("DEUTDEFF")
Validates hex color codes in #RGB, #RGBA, #RRGGBB, or #RRGGBBAA format.
is_color_hex(x)is_color_hex(x)
x |
( |
TRUE if x is a valid hex color string, FALSE otherwise.
https://www.w3.org/TR/css-color-4/#hex-notation
is_color_hex("#FF5733") is_color_hex("#fff")is_color_hex("#FF5733") is_color_hex("#fff")
Check if an argument is a CUID2 string
is_cuid2(x)is_cuid2(x)
x |
( |
TRUE if x is a valid CUID2 string, FALSE otherwise.
is_cuid2("ckopqwooh000001la8mbi2im9")is_cuid2("ckopqwooh000001la8mbi2im9")
Validates CUSIP format including Luhn-variant check digit verification.
is_cusip(x)is_cusip(x)
x |
( |
TRUE if x is a valid CUSIP string, FALSE otherwise.
https://en.wikipedia.org/wiki/CUSIP
is_cusip("037833100")is_cusip("037833100")
Check if an argument is a DOI string
is_doi(x)is_doi(x)
x |
( |
TRUE if x is a valid DOI string, FALSE otherwise.
https://www.doi.org/the-identifier/what-is-a-doi/
is_doi("10.1038/nphys1170")is_doi("10.1038/nphys1170")
Check if an argument is a email address string
is_email(x)is_email(x)
x |
( |
TRUE if x is a valid email address string, FALSE otherwise.
is_email("[email protected]")is_email("[email protected]")
Validates FIGI (Financial Instrument Global Identifier) format including Luhn check digit verification.
is_figi(x)is_figi(x)
x |
( |
TRUE if x is a valid FIGI string, FALSE otherwise.
https://en.wikipedia.org/wiki/Financial_Instrument_Global_Identifier https://www.openfigi.com/about/overview
is_figi("BBG000BLNNH6")is_figi("BBG000BLNNH6")
Check if an argument is a hexadecimal string
is_hex(x)is_hex(x)
x |
( |
TRUE if x is a valid non-empty hexadecimal string, FALSE
otherwise.
is_hex("deadbeef")is_hex("deadbeef")
Check if an argument is a hostname string
is_hostname(x)is_hostname(x)
x |
( |
TRUE if x is a valid hostname string, FALSE otherwise.
https://en.wikipedia.org/wiki/Hostname
is_hostname("example.com")is_hostname("example.com")
Validates IBAN format including MOD-97-10 check digit verification (ISO/IEC 7064).
is_iban(x)is_iban(x)
x |
( |
TRUE if x is a valid IBAN string, FALSE otherwise.
https://en.wikipedia.org/wiki/International_Bank_Account_Number
is_iban("GB29NWBK60161331926819")is_iban("GB29NWBK60161331926819")
Check if an argument is an IPv4 address string
is_ipv4(x)is_ipv4(x)
x |
( |
TRUE if x is a valid IPv4 address string, FALSE otherwise.
is_ipv4("192.168.1.1")is_ipv4("192.168.1.1")
Validates full, compressed (::) and IPv4-embedded (::ffff:192.168.1.1) forms.
Zone IDs (e.g. %eth0) are not supported.
is_ipv6(x)is_ipv6(x)
x |
( |
TRUE if x is a valid IPv6 address string, FALSE otherwise.
is_ipv6("2001:0db8:85a3:0000:0000:8a2e:0370:7334") is_ipv6("::1")is_ipv6("2001:0db8:85a3:0000:0000:8a2e:0370:7334") is_ipv6("::1")
Validates ISBN-10 and ISBN-13 formats, including check digit verification. Hyphens and spaces are allowed as separators.
is_isbn(x)is_isbn(x)
x |
( |
TRUE if x is a valid ISBN string, FALSE otherwise.
https://en.wikipedia.org/wiki/International_Standard_Book_Number
is_isbn("978-0-306-40615-7")is_isbn("978-0-306-40615-7")
Validates ISIN (International Securities Identification Number) format including Luhn check digit verification.
is_isin(x)is_isin(x)
x |
( |
TRUE if x is a valid ISIN string, FALSE otherwise.
https://en.wikipedia.org/wiki/International_Securities_Identification_Number
is_isin("US0378331005")is_isin("US0378331005")
Validates the YYYY-MM-DD format with calendar correctness, including leap year handling.
is_iso_date(x)is_iso_date(x)
x |
( |
TRUE if x is a valid ISO 8601 date string, FALSE otherwise.
https://en.wikipedia.org/wiki/ISO_8601
is_iso_date("2024-01-15") is_iso_date("2024-02-30")is_iso_date("2024-01-15") is_iso_date("2024-02-30")
Validates the YYYY-MM-DDTHH:MM:SS[.sss] format with calendar correctness, including leap year
handling. The timezone designator is optional and can be Z or an offset like +05:30.
is_iso_datetime(x)is_iso_datetime(x)
x |
( |
TRUE if x is a valid ISO 8601 datetime string, FALSE otherwise.
https://en.wikipedia.org/wiki/ISO_8601
is_iso_datetime("2024-01-15T12:00:00Z") is_iso_datetime("2024-01-15T12:00:00+05:30") is_iso_datetime("2024-01-15T12:00:00")is_iso_datetime("2024-01-15T12:00:00Z") is_iso_datetime("2024-01-15T12:00:00+05:30") is_iso_datetime("2024-01-15T12:00:00")
Validates ISSN format including check digit verification.
is_issn(x)is_issn(x)
x |
( |
TRUE if x is a valid ISSN string, FALSE otherwise.
https://www.loc.gov/issn/check.html
is_issn("0378-5955")is_issn("0378-5955")
Validates LEI (Legal Entity Identifier) format including MOD-97-10 check digit verification (ISO/IEC 7064).
is_lei(x)is_lei(x)
x |
( |
TRUE if x is a valid LEI string, FALSE otherwise.
https://en.wikipedia.org/wiki/Legal_Entity_Identifier https://www.govinfo.gov/content/pkg/CFR-2016-title12-vol8/xml/CFR-2016-title12-vol8-part1003-appC.xml
is_lei("7H6GLXDRUGQFU57RNE97")is_lei("7H6GLXDRUGQFU57RNE97")
Check if an argument is a MAC address string
is_mac(x)is_mac(x)
x |
( |
TRUE if x is a valid MAC address string, FALSE otherwise.
is_mac("00:1B:44:11:3A:B7")is_mac("00:1B:44:11:3A:B7")
Check if an argument is an MD5 hash string
is_md5(x)is_md5(x)
x |
( |
TRUE if x is a valid MD5 hash string, FALSE otherwise.
is_md5("d41d8cd98f00b204e9800998ecf8427e")is_md5("d41d8cd98f00b204e9800998ecf8427e")
Validates the type/subtype format where the top-level type must be one of the IANA-registered
types: application, audio, font, image, message, model, multipart, text, or
video.
is_mime(x)is_mime(x)
x |
( |
TRUE if x is a valid MIME type string, FALSE otherwise.
https://www.iana.org/assignments/media-types/media-types.xhtml
is_mime("application/json") is_mime("text/plain")is_mime("application/json") is_mime("text/plain")
Check if an argument is a Nano ID string
is_nanoid(x)is_nanoid(x)
x |
( |
TRUE if x is a valid Nano ID string, FALSE otherwise.
is_nanoid("V1StGXR8_Z5jdHi6B-myT")is_nanoid("V1StGXR8_Z5jdHi6B-myT")
Validates ORCID format including ISO/IEC 7064:2003, MOD 11-2 check digit verification.
is_orcid(x)is_orcid(x)
x |
( |
TRUE if x is a valid ORCID string, FALSE otherwise.
https://support.orcid.org/hc/en-us/articles/360006897674-Structure-of-the-ORCID-Identifier
is_orcid("0000-0002-1825-0097")is_orcid("0000-0002-1825-0097")
Validates SEDOL format including weighted check digit verification.
is_sedol(x)is_sedol(x)
x |
( |
TRUE if x is a valid SEDOL string, FALSE otherwise.
https://en.wikipedia.org/wiki/SEDOL
is_sedol("0263494")is_sedol("0263494")
Validates semantic versioning 2.0.0 format, including optional pre-release and build metadata. Uses the official recommended regex from https://semver.org/.
is_semver(x)is_semver(x)
x |
( |
TRUE if x is a valid semver string, FALSE otherwise.
is_semver("1.0.0")is_semver("1.0.0")
Check if an argument is a SHA-256 hash string
is_sha256(x)is_sha256(x)
x |
( |
TRUE if x is a valid SHA-256 hash string, FALSE otherwise.
is_sha256("e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855")is_sha256("e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855")
Check if an argument is a ULID string
is_ulid(x)is_ulid(x)
x |
( |
TRUE if x is a valid ULID string, FALSE otherwise.
is_ulid("01ARZ3NDEKTSV4RRFFQ69G5FAV")is_ulid("01ARZ3NDEKTSV4RRFFQ69G5FAV")
Check if an argument is url string
is_url(x)is_url(x)
x |
( |
TRUE if x is a valid URL string, FALSE otherwise.
is_url("https://example.com")is_url("https://example.com")
Check if an argument is an UUID string
is_uuid(x)is_uuid(x)
x |
( |
TRUE if x is a valid UUID string, FALSE otherwise.
is_uuid("550e8400-e29b-41d4-a716-446655440000")is_uuid("550e8400-e29b-41d4-a716-446655440000")