Reference · Parsing, formatting and shared types
GENERAL_DELIVERY_PATTERNSconstant
General delivery written alone or before a city.
Import it
import { GENERAL_DELIVERY_PATTERNS } from "@johnmorrisdotca/address-plus";
Definition
const GENERAL_DELIVERY_PATTERNS: { readonly STANDARD: RegExp; readonly WITH_CITY: RegExp; } = {
STANDARD: /^(?:general\s+delivery|gd|poste\s+restante)(?:\s+(?:stn\.?|station|succ\.?|succursale)\s+\S.*)?$/i,
WITH_CITY: /^\s*general\s+delivery\s+([^,]+?)\s+([A-Za-z]{2})\b/i,
} as const
Members
| Name | Type | Description |
|---|---|---|
STANDARD | RegExp | |
WITH_CITY | RegExp |
Examples
import { GENERAL_DELIVERY_PATTERNS } from "@johnmorrisdotca/address-plus";
console.log(GENERAL_DELIVERY_PATTERNS.STANDARD.test("General Delivery"));
// → truetrueWhat it prints (run when this page was built)