How to use the remove lines containing
- 1Paste your text into Lines to filter.
- 2Type one or more terms into Words or phrases, separated by commas.
- 3Choose Remove them or Keep only them, and Any of them or All of them.
- 4Switch Show to Removed lines to check what was taken out, then copy the result.
Example
10:01 INFO server started 10:02 WARNING disk 85% full 10:03 ERROR could not reach database 10:04 INFO request served in 120 ms 10:05 error retrying connection
10:01 INFO server started 10:02 WARNING disk 85% full 10:04 INFO request served in 120 ms
Default settings: Words or phrases = error, Remove them, case ignored. Both the “ERROR” and the “error” lines go.
Removing lines that contain a word
A line is removed if the term appears anywhere in it, including inside a longer word: cat matches “category”. Tick Whole words only to match the word on its own, and Match case if capitals matter. The footer shows how many lines were removed and kept.
Keeping only matching lines
Choose Keep only them to do the opposite: everything that doesn't match is removed, like the grep command. With the example log and the terms error, warning, the result is the WARNING line and both error lines. Switch Show to Removed lines to see the lines that were filtered out in either mode.
Several rules with AND/OR
Separate several terms with commas. Any of them matches a line that contains at least one term (OR); All of them matches only lines that contain every term (AND). To use a comma inside a term, type \,.
For “contains A but not B”, run the tool twice: first Keep only them with A, then press Reuse and Remove them with B.
Regex filters for logs and data
Tick Regular expressions to treat each term as a JavaScript regular expression:
| Pattern | Matches lines |
|---|---|
^\s*$ | that are empty or only spaces |
^# | that start with # (comments) |
\b5\d\d\b | with a 5xx status code |
^\d{4}-\d\d-\d\d | that start with a date |
An invalid pattern shows an error instead of a result. To replace text rather than filter lines, use find and replace.
Is my text private?
This tool runs entirely in your browser. Your text is not uploaded to our servers.
