Reference · Parsing, formatting and shared types
CANADIAN_POSTAL_LIBERAL_PATTERNconstant
A Canadian postal code of any letters, for finding one before it is checked.
Import it
import { CANADIAN_POSTAL_LIBERAL_PATTERN } from "@johnmorrisdotca/address-plus";
Definition
const CANADIAN_POSTAL_LIBERAL_PATTERN: RegExp = /([A-Z]\d[A-Z][-\s]*\d[A-Z]\d)/i
Examples
import { CANADIAN_POSTAL_LIBERAL_PATTERN } from "@johnmorrisdotca/address-plus";
console.log(CANADIAN_POSTAL_LIBERAL_PATTERN.test("m5h2n2"));
// → truetrueWhat it prints (run when this page was built)