Skip to contents

With or without one space is permitted. Does not work with data where two spaces are included with 6 character postcodes. From the MIT licenced package Rbduk https://github.com/sama-ds/Rbduk/blob/main/R/is_postcode.R

Usage

is_postcode(data)

Arguments

data

string

Value

Logical

Examples

is_postcode("SW1a2nP")
#> [1] TRUE
is_postcode("SW1a 2nP")
#> [1] TRUE