Skip to content

Street Addresses

Filter

This filter identifies US-style street addresses in text and reports them with the span type street-address. It detects the street line of an address:

  • A house number of up to six digits, optionally a range or with a letter (123, 123-125, 12B).
  • Up to five words of street name, optionally after a directional (North, NW, and so on).
  • A street type, written in full or abbreviated, such as Street or St, Avenue or Ave, Boulevard, Drive, Road, Lane, Way, Court, Place, Highway, Parkway, Trail, Terrace, and others.
  • Optionally a directional after the street type (1600 Pennsylvania Avenue NW) and a unit (Apt 4, Suite 100, Unit 2, #5, Floor 3, and similar), which are included in the span.

It also detects PO boxes, such as PO Box 1234, P.O. Box 56, and Post Office Box 789.

For example, in Send it to 123 Main Street, Suite 100, Springfield, IL 62701, the filter reports 123 Main Street, Suite 100. The city, state, and ZIP code are not part of the span; use the City, State, and Zip Code filters to detect them. A period directly after the street type is part of the span, since abbreviations such as St. end with one, so an address at the end of a sentence includes the sentence's period.

Not detected:

  • An address without a street type, such as 42 Broadway.
  • Addresses written in other countries' formats, such as Hauptstrasse 5.
  • Rural route addresses, such as RR 2 Box 15.

Matching ignores case, and several street types are ordinary words (Path, Run, Walk, Point, Way), so ordinary text can be reported as an address: Walked 5 miles down the path contains a number, words, and path. Detection is based on the format of the text; validate the results against your own documents.

Required Parameters

This filter has no required parameters.

Optional Parameters

Parameter Description Default Value
streetAddressFilterStrategies A list of filter strategies. None
enabled When set to false, the filter will be disabled and not applied true
ignored A list of terms to be ignored by the filter. None

The common filter properties also apply.

Filter Strategies

The filter may have zero or more filter strategies. When no filter strategy is given the default strategy of REDACT is used. When multiple filter strategies are given, they are evaluated in the order listed and only the first one whose condition is satisfied, or that has no condition, is applied. See Filter Strategies for details.

Strategy Description
REDACT Replace the sensitive text with a placeholder.
MASK Replace each character of the sensitive text with a mask character (* by default).
TRUNCATE Replace all but a few characters of the sensitive text with a truncation character (* by default).
RANDOM_REPLACE Replace the sensitive text with a similar, random value.
STATIC_REPLACE Replace the sensitive text with a given value.
CRYPTO_REPLACE Replace the sensitive text with its encrypted value.
HASH_SHA256_REPLACE Replace the sensitive text with its SHA256 hash value.
FPE_ENCRYPT_REPLACE Replace the sensitive text with a value generated by format-preserving encryption (FPE)
LAST_4 Replace the sensitive text with just the last four characters of the text.

Conditions

Each filter strategy may have one condition. See Conditions for details.

Conditional Description Operators
TOKEN Compares the value of the sensitive text. ==, !=, startswith
CONTEXT Compares the filtering context. == , !=
CONFIDENCE Compares the confidence in the sensitive text against a threshold value. < , <=, > , >=, ==, !=

Example Policy

{
   "identifiers": {
      "streetAddress": {
         "streetAddressFilterStrategies": [
            {
               "strategy": "REDACT",
               "redactionFormat": "{{{REDACTED-%t}}}"
            }
         ]
      }
   }
}