Skip to main content

Filter Lines

Keep lines that contain the query, or invert to drop matches. Optional ignore case and regular expressions. This is not unique-lines and not find-replace.

Rated 4.7 out of 5 based on 433 reviews

Input
Output

How to filter lines

  1. Paste one item per line in Input.
  2. Type the query. Turn ignore case on to match Red and red. Turn regex on only if the query is a pattern.
  3. Leave invert off to keep matches. Turn invert on to keep lines that do not match.
  4. Copy the kept lines. Invalid regex shows in the status line. Nothing is uploaded.

Line filter

Keep or drop lines that contain a query

ContainsSubstring match unless regex is on
Ignore caseen-US lowercasing for plain text
InvertKeep lines that miss the query
RegexJavaScript RegExp; invalid patterns error in status
Empty queryKeep all lines, or none if invert is on
UploadNone

What filter lines does

Each line is tested against the query. Plain mode uses includes. Regex mode compiles the query. Invert flips the keep set. Order of kept lines is unchanged.

Grep versus unique versus replace

This is a keep/drop filter, like a small grep. Deduping is remove duplicate lines. Ordering is sort list. Set differences are compare lists. Changing text inside a line is find and replace.

Invalid regular expressions

A bad pattern throws. The status line shows the engine error and the previous output is cleared. Flags beyond ignore-case are not a separate field. The i flag follows the checkbox.

Use cases

Keeping log lines that mention error, dropping comments, or a regex for digits. Blank query with invert off returns the original lines.

Limits

Work stays in this tab. Huge pastes are limited by the browser. CZNull does not receive the list.

Filter lines questions

Does this page upload my list?
No. The work runs in the page you opened. CZNull does not receive the input.
How is this different from unique lines?
Unique drops duplicate rows. Filter keeps or drops rows that match a query. Duplicates can remain.
How is this different from find and replace?
Find and replace edits inside lines. Filter keeps or removes whole lines.
What happens if the regex is invalid?
The status line shows the error. The previous result is cleared.
What does invert do?
It keeps lines that do not contain the query (or do not match the regex).
What if the query is empty?
Without invert, every line is kept. With invert, the output is empty.