find_postcodes_in_string: Find postcodes in a string.

Description Usage Arguments Value TODO See Also Examples

View source: R/address.R

Description

Returns an empty string where no match is found. The string can be an address or any text string. For large flat files, use find_postcodes().

Usage

1
find_postcodes_in_string(string, locale = "GBR")

Arguments

string

Input vector. Either a character vector, or something coercible to one (e.g. a data frame).

locale

A string, the country code in format ISO 3. Default is "GBR".

Value

A character vector containing all the matches.

TODO

Handle extra white spaces: try trimming ws inside postcode if not match Handle special cases with lower casing without interferring with other strings such as Ec2M 1aA Handle case: currently only findingpostcodes that are in caps (to deal with possible typos, see test)

See Also

find_postcodes()

Examples

1
2
string <- "The quick brown fox lives at 6 Bridge Road, N17 0RN."
find_postcodes_in_string(string)

xavier-gilbert/sabre documentation built on May 7, 2021, 12:40 p.m.