Skip to content

Tool 37 / Clean lists

Keep the lines that matter.

Filter a list or a log by content. Remove every line that contains a term, or keep only the matches — with whole-word, case, and regex control.

  • Free to use
  • Any or all terms
  • Runs locally
Live workbench3 of 5 lines kept
Lines left after removal

How matching works

Every non-empty line in the terms box is a separate search. A line is removed when any term appears anywhere in it, unless you choose “every term matches” or switch to keep-only mode. The line itself is never rewritten; it is either kept or dropped.

Whole-word matching checks letters, numbers, and underscores at the boundaries. With regular expressions on, each term is compiled with the Unicode flag and applied to one line at a time. An invalid pattern is reported instead of being silently skipped.

5 lines in3 kept2 removedremove actionLine filter · never uploaded

What it does

This is a line filter. It reads one record per line and decides whether that whole line stays or goes. A line that contains any of your terms is removed by default; a line that does not match is kept exactly as it was, including its spacing and punctuation.

It is different from find and replace. Replace edits the matched text and leaves the line in place. Filter asks a yes-or-no question about the line and either keeps it or drops it. That makes it useful for log excerpts, keyword lists, exported notes, and any list where the presence of a phrase marks a row as irrelevant.

Any, all, and inversion

Enter one term per line. With “any term matches,” a line is removed when at least one term appears anywhere in it. With “every term matches,” all of the terms must appear before the line is removed. The terms do not have to be adjacent, and their order does not matter. Empty terms are ignored, and duplicate terms are collapsed.

The action selector flips the test. “Keep only matching lines” is the inverse of removal: the matched lines survive and the rest are dropped. In both directions, the line content is not changed. If you need to edit the surviving text as well, run it through find and replace or clean text afterward.

Whole words and regex

Whole-word matching is the safer choice for short terms. Without it, “cat” also matches “catalog” and “copycat.” With it, the engine checks that the characters immediately around the match are not letters, numbers, or underscores. The check is Unicode-aware, so accented letters count as word characters too.

Regular expressions are available when a plain substring is not enough. Each line in the terms box is compiled as its own pattern, with the Unicode flag and case-insensitive matching unless you enable case sensitivity. A syntax error is shown above the result rather than guessed around. Complex patterns can be slow on long lines, so keep an eye on the tab if a pattern uses heavy backtracking.

Examples

Remove two kinds of status line
Terms: down, warm · remove · any match

Before

Server alpha is healthy
Server beta is down
Database alpha is healthy
Cache beta is warm
Backup alpha is missing

After

Server alpha is healthy
Database alpha is healthy
Backup alpha is missing

The two lines containing “down” and “warm” are removed. The alpha lines stay because neither term appears in them. The blank line behavior is unchanged: there is no blank line in this input, and the filter does not invent one.

Keep only error lines
Terms: ERROR · keep only matching lines

Before

2026-10-27 09:14 INFO  worker started
2026-10-27 09:15 ERROR queue timeout
2026-10-27 09:16 INFO  retry scheduled
2026-10-27 09:17 ERROR disk full

After

2026-10-27 09:15 ERROR queue timeout
2026-10-27 09:17 ERROR disk full

In keep-only mode the filter is an inclusion list. Both ERROR lines survive, including their timestamps and spacing. The INFO lines disappear. If the log used lowercase “error,” the default case-insensitive setting would still match; turn on case sensitivity when the distinction matters.

Limits worth knowing

  • It is line-oriented. A record that spans several lines is several records. Multiline quoted CSV fields, stack traces, and wrapped prose will be filtered line by line, not as logical blocks.
  • Terms are literal by default. A period, bracket, or asterisk is an ordinary character until you enable regex. That is deliberate: log lines and filenames are full of punctuation that would otherwise become a pattern.
  • Whole-word is not a dictionary. It checks boundaries, not meaning. It will not distinguish “bank” as a financial institution from “bank” as a river edge.
  • Regex can be expensive. A pathological pattern on a very long line can make the tab unresponsive. Use a simple substring when it will do, and test complex patterns on a small excerpt first.
  • No file upload. Paste the text or copy it from a local file. The page does not read files from disk by itself.

Page updated

Questions, answered

What is the difference between removing and keeping matches?

The default action removes every line that matches one of your terms. “Keep only matching lines” inverts the test, so the output contains only the lines that match and everything else is dropped. It is the same filter viewed from the other side.

What does “any term” versus “every term” mean?

With “any,” a line is removed if at least one term appears. With “every,” a line is removed only if all the terms appear somewhere in that line. The order of the terms does not matter, and a term can appear more than once.

How does whole-word matching work?

It adds a boundary check that treats letters, numbers, and underscores as word characters. Searching for “cat” then matches cat but not catalog or copycat. It is a Unicode-aware approximation of a word boundary, not a dictionary lookup.

Can I use a regular expression?

Yes. Turn on the regex option and each non-empty line in the terms box becomes a pattern. Matching is case-insensitive unless you enable case sensitivity, and the Unicode flag is applied. An invalid pattern produces an error instead of silently removing everything.

Does it remove blank lines?

Only if a blank line matches one of your terms. It is a line filter, not a blank-line cleaner. Use the Remove Empty Lines tool for blank rows, and use this tool when the content of a line decides whether it stays.

Is the pasted text uploaded?

No. The filter runs in this browser tab. The terms, the input, and the result stay local, with no account or stored copy on the server.

All tools →