Grep a list

Grep a list in the browser - paste your lines, type a pattern, keep the matches. Same shape as command-line `grep` / `grep -v`: toggle Invert for the inverse, switch Mode to `regex` for `grep -E` semantics. Same op family as Filter list lines with a dev-focused framing.

Input
Ready
Output
Live

Grep-style line matching, no terminal required

Five modes cover the common grep flags. Contains is plain `grep pattern`. Equals (after trim) is `grep -xF pattern`. Starts with / Ends with anchor to one end. Regex is `grep -E` with JavaScript regex syntax - groups, alternation, lookaheads all work.

Whole word wraps the pattern in `\b...\b` for Contains and Equals modes, matching `grep -w`. Case sensitive off (default) is `grep -i`. Invert is `grep -v`. Invalid regex clears the output (empty result) and surfaces the error message in the status bar.

For paragraph-level (blank-line-separated) matching use Filter paragraphs. For field-level word matching within lines, use Filter words.

How to use grep a list

  1. 1Paste your list into the input panel
  2. 2Type your Match pattern (text or regex)
  3. 3Pick Mode: Contains (default), Equals, Starts with, Ends with, or Regex
  4. 4Toggle Invert for `grep -v` semantics
  5. 5Toggle Whole word for `grep -w`, Case sensitive to flip `-i`

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

Grep-style line filter, five modes, three toggles.

Five modes map to common grep flags

Contains = plain grep. Equals = `grep -xF`. Regex = `grep -E`. Starts with / Ends with anchor one end. Pick the mode that matches the semantic intent of the filter.

Invert = `grep -v`

Flip the keep/drop decision with the Invert toggle. Same pattern, opposite outcome - useful for dropping noise without rewriting the pattern as a negation.

Whole word = `grep -w`

Wraps the pattern in word-boundary anchors in Contains / Equals modes. `cat` matches `the cat` but not `category`. Ignored in Regex mode - encode `\b` yourself.

Case sensitive toggle

Off by default (like `grep -i`). Flip on to distinguish `Apple` from `apple`. Applies to all five modes.

Invalid regex never crashes

Malformed regex clears the output (empty result) and surfaces the error message in the status bar. The input textarea is untouched, so you can edit the pattern and retry immediately.

Common use cases

Concrete scenarios where in-browser grep beats opening a terminal.

Quick log filtering

Paste a copied log segment from a dashboard, web console, or error monitor. Grep for `error`, `panic`, or `5\d\d` (Regex mode) to surface incidents without saving the log to disk.

Pattern sweeps in pasted output

Running `ls -la`, `docker ps`, or `kubectl get pods` in a terminal and want to filter? Paste the output, grep for the container/pod name, get the row instantly - no shell pipes required.

Noise removal via Invert

Toggle Invert to drop known noise: `DEBUG`, `healthcheck`, `favicon.ico`. Same power as `grep -v` without memorizing the flag.

Regex search in scraped data

Switch to Regex mode with patterns like `\b[A-Z]{2,}\b` (acronyms), `\d{4}-\d{2}-\d{2}` (ISO dates), or `#\w+` (hashtags) to extract structured shapes from free-form text.

Worked example

An example of filtering lines based on a specific pattern.

Input
apple
banana
carrot
apple pie
banana bread
Output
apple
apple pie

Settings reference

How each option shapes the filtered output using the sample above (default pattern `apple`, Contains mode).

Setting What it does Effect on the sample
Mode: Contains + `apple` `grep apple` `apple` + `apple pie`
Mode: Equals + `apple` `grep -xF apple` (exact match, trimmed) `apple` only
Mode: Regex + `^a.+e$` `grep -E` anchored `apple` + `apple pie`
Whole word + Contains + `apple` `grep -w apple` Same as Contains on this sample (no partial hits)
Invert: on + `apple` `grep -v apple` `banana` + `carrot` + `banana bread`
Case sensitive: on + `APPLE` Flips off `grep -i` 0 matches (sample is all lowercase)

FAQ

What are the grep flag equivalents?
Invert = `-v`, Whole word = `-w`, Case sensitive off = `-i`, Mode Regex = `-E`, Mode Equals = `-xF`. The defaults (Contains, case-insensitive) match a plain `grep -i`.
What if my regex is invalid?
Output clears to empty and the status bar shows the error message. Your input textarea is untouched - fix the pattern and the output repopulates.
Does this work the same as Filter list lines?
Same op, same output. Filter list lines is the alternative URL with non-dev framing. Pick whichever matches your mental model.
Can I pipe output into another tool?
Copy the output and paste it into another ListShift tool, or use a Plus <a href="/account/pipelines/">pipeline</a> (Plus subscribers sign in, then chain multiple transforms in one click).
How do I grep multiple patterns at once?
Switch to Regex mode and use alternation: `apple|banana|cherry`. Each line matching any alternative is kept.