Find cities in a list

Extract place names from address dumps, shipping manifests, CRM exports, or mixed text - default regex matches `Paris`, `New York`, and `Rio-de-Janeiro`-style capitalized-word shapes. No built-in city database, so `Jane Smith` also matches. For authoritative filtering, swap the pattern for an alternation: `^(Paris|London|Tokyo|New York)$`.

Input
Ready
Output
Live

Pattern-based, not database-backed

This is the Filter tool with a regex default tuned for the shape of city names: capitalized-first-letter words, optionally joined by spaces or hyphens. No list of known cities is shipped with this tool - `Unicorn` would also pass if it were on a line by itself.

Use one-item-per-line input. The filter keeps whole lines that contain a match to the pattern. `New York, NY 10001` on one line would be kept because `New York` matches, but the whole line (including the zip code) is emitted.

For strict city matching, replace the default pattern with an alternation of your known cities: `^(Paris|London|Tokyo|New York)$`. For country-aware matching, combine with external data - this tool has no built-in geo knowledge.

How to use find cities in a list

  1. 1Put one item per line into the input panel
  2. 2Default pattern matches capitalized-word sequences
  3. 3Swap pattern for an exact city list if you have one: `^(Paris|London|Tokyo)$`
  4. 4Toggle Invert to drop city-shaped lines instead
  5. 5Whole-word toggle has no effect in Regex mode

Keyboard shortcuts

Drive ListShift without touching the mouse.

Shortcut Action
Ctrl ZUndo last input change
Ctrl Shift ZRedo
Ctrl Shift EnterToggle fullscreen focus on the editor
EscExit fullscreen
Ctrl KOpen the command palette to jump to any tool
Ctrl SSave current pipeline draft Plus
Ctrl PRun a saved pipeline Plus

What this tool actually does

Regex filter, pre-tuned for capitalized-proper-noun shapes.

Default pattern: capitalized-word chains

Single words (`Paris`), space-separated (`New York`), or hyphen-joined (`Rio-de-Janeiro`) all match.

Not a city database

Any capitalized proper noun shape matches - including personal names. For authoritative city-only filtering, replace the pattern with an alternation of exact city names.

Case-sensitive by default

Lowercased words like `paris` do NOT match. This is intentional - city names are conventionally capitalized, so requiring capitalization filters out noise like generic nouns.

Keeps whole lines

A line like `Contact: Jane Smith, New York, NY` would be kept (matches `Jane`, `Smith`, `New`, `York`). To extract just the city, use Replace with a capture group.

Invert to drop capitalized lines

Toggle Invert to keep only lines WITHOUT a capitalized-word pattern - useful for stripping names/places from free-text.

Common use cases

Concrete scenarios where a capitalized-proper-noun filter earns its keep.

Address and shipping manifests

Paste a block of shipping labels or order addresses and the filter surfaces lines containing a city-shaped word. Chain Dedupe to collapse repeat destinations.

CRM exports with mixed location fields

Contact exports mix city, region, country, and free-form notes. Filter to city-shaped lines, then use Find most frequent to rank by destination volume.

Travel-itinerary cleanup

Scrape an itinerary, flight log, or booking confirmation - lines with place names stay, lines with dates/prices/numbers drop. Fast first pass before manual review.

Invert to strip place names

Toggle Invert to remove place-shaped lines - useful for anonymizing text dumps or pre-processing text for word-frequency analysis where place names would dominate.

Worked example

Capitalized proper-noun lines are kept; lowercase words (which do not match the default pattern) are dropped.

Input
Paris
apple
New York
orange
Rio de Janeiro
banana
London
Output
Paris
New York
Rio de Janeiro
London

Settings reference

How each option shapes the output using the sample above.

Setting What it does Effect on the sample
Pattern: default, Mode: Regex Keeps capitalized-proper-noun lines `Paris` / `New York` / `Rio de Janeiro` / `London`
Pattern: `^(Paris|London|Tokyo)$` Strict alternation - only exact matches Only `Paris` and `London` would match
Case sensitive: off Capitalization no longer required `paris` (lowercase) would also match
Invert: on Drops capitalized lines Keeps `apple` / `orange` / `banana`
Whole word: on (Regex mode) Ignored - regex handles its own boundaries No effect

FAQ

Is there a built-in list of cities?
No. The tool uses a shape-based regex - anything matching "one or more capitalized words" passes. For authoritative filtering, supply a pattern like `^(Paris|London|Tokyo|New York|...)$`.
Why does `Jane Smith` also match?
Because it fits the capitalized-proper-noun shape. The default pattern cannot distinguish cities from personal names or other proper nouns. For precision, use an explicit city alternation.
How do I keep only exact city names?
Change the pattern to `^(City1|City2|City3)$` with an alternation of your known cities. The `^` and `$` anchors force whole-line matching.
Does it handle lowercase city names?
Not by default - Case sensitive is on, so `paris` is dropped. Toggle it off if your data has casing inconsistencies.
Can I extract just the city names from mixed text?
This tool is a line filter, not an extractor. For extraction from within lines, use Replace with a capture group regex.