Line Filter

Keep or remove matching lines from text locally in your browser.

Share on LinkedInShare on X
Link to this tool

Copy this HTML to cite this tool from your own site or article.

About Line Filter

Line Filter filters text line-by-line based on search terms or regular expressions. You can keep or remove matching lines to clean log files, lists, and code snippets.

How to use Line Filter

  1. Paste your multi-line text into the input field.
  2. Type the search term or regular expression pattern.
  3. Select whether to keep matching lines or remove matching lines.
  4. Click Filter Text to process the text and copy output.

Examples

Input: error: server down info: ok error: timeout Pattern: error Output: error: server down error: timeout

FAQ

Can I use regular expressions in the filter?

Yes. Enable the Regex option to supply standard JavaScript regular expression patterns.

How are blank lines handled?

Blank lines are evaluated like any other line. You can strip empty lines by matching non-whitespace characters.