Find & Replace
Search runs on a byte-level scanning engine that covers ten gigabytes in about a second, and every count it reports is exact.
The find bar
Press ⌘F. Matches highlight throughout the document as you type, with a live counter and, on big scans, a progress readout ("Searching… 42%").
160,846 matches in an 8-million-line log, found in about a quarter of a second. Enter walks matches; the current one gets the ring.
- Return / ⌘G: next match. ⇧⌘G: previous.
- Aa: match case. W: whole words. .*: ICU regular expressions.
- \n: escape sequences:
\n\t\r\0\\\xHH\uHHHHexpand in literal queries and replacements, so you can search across line boundaries. - The clock icon recalls recent searches.
- ⌘E uses the current selection as the search term.
At scale: finding all 1,613,344 occurrences of a term in the 10 GB benchmark log takes 1.3 s; a five-way regex alternation with 5.6M matches takes 2.1 s.
The same find bar against 10 GB: 1.61 million matches, counted exactly.
Replace
Press ⌥⌘F for the replace row.
Replace the current match or everything at once. Regex mode supports capture-group templates in the replacement.
Replace All is a single bulk operation, not a loop: replacing all 1.61 million matches in the 10 GB log takes 1.7 s, lands as one undo step, and the document is fully re-indexed the moment it returns. Very large batches (about a million sites and up) can exceed the undo-history memory cap; Caxton tells you rather than guessing.
The Advanced Find panel
Everything in one panel: search history, all options, Count, Find All, Bookmark All, and both replace actions.
- Count: exact match count without moving the cursor.
- Find All: every match in the results panel, clickable.
- Bookmark All: drop a bookmark on every matching line.
- Presets: save a search under a name (options and replacement included), and move preset sets between Macs as JSON.
The results panel
Find All lists every match with its line and context; click to jump. The tools row works the list like data: group by regex capture (the $1 value; the whole match when the pattern has no group) or by CSV column in grid mode, sort by match text, Filter to Matches (one click hands the query to the filter bar), and Export (grep-style N: line text to a new document, one line per document line). Grouping caps at 100,000 matches and says so; the flat document-order list has no cap.
Batch Replace
Edit ▸ Find ▸ Batch Replace… runs a LIST of find/replace pairs, each with its own case, whole-word, and regex options. The mode popup states the semantics in plain words:
- One pass: every pair matches the original text, overlapping matches go to the earlier pair, and the whole run is one undo step. A pair's output is never re-matched by a later pair.
- In order: each pair sees the previous pair's output and can match it; one undo step per pair.
Every row reports found, replaced, and dropped counts after a run, and an invalid regex in one pair never stops the others. Pair lists import and export as CSV or TSV (embedded commas, quotes, and tabs survive the round trip), and named presets keep the mode with the list. Scope is this document or all open documents; a read-only document reports in the summary instead of cancelling the run.
Find in Files
⇧⌘F searches files on disk without opening them, streaming results as they're found. Filename patterns (*.log; *.csv) narrow the walk; the scope popup switches to every open document instead of a folder.
What it skips, it reports: files over the 50 MB scan cap, binary files, and unreadable files are listed behind the Skipped button, never silently omitted. UTF-16 files decode and get searched. On a single line longer than 1 MB, a literal query matches exactly at any length; a regex is judged on the start of the line and the file lands in the skip report, saying so.
Replace… extends a search across files, carefully: a preview with per-file counts before anything is touched, .bak backups on by default, atomic per-file writes, and a report covering every skipped file and why. Documents open in Caxton are skipped there; Batch Replace covers them.