TSToolSeta
Text Tools · Ready

Line Filter

Keep or exclude lines with literal, boundary, or regex matching.

Workbench online
Loading tool controls…

Line Filter guide

Keep or exclude lines using literal text, boundary matching, exact comparison, or a regular expression.

What this tool does

The Line Filter processes plain text one line at a time. A line can match when it contains the query, starts with it, ends with it, equals it exactly, or satisfies a JavaScript regular expression. Matching can be case-sensitive or case-insensitive. The invert option keeps non-matching lines instead, and a separate control can retain blank lines regardless of the query.

The result panel shows the filtered text and reports how many source lines matched and how many were kept. You can copy the output or download it as a UTF-8 text file. This is useful for log excerpts, labeled lists, status exports, simple inventories, and other line-oriented data.

The tool does not understand CSV quoting, multiline records, log severity semantics, spreadsheet columns, or structured JSON. A visual line created by word wrapping is not a real newline and therefore is not processed separately. Regular expressions follow the current browser’s JavaScript syntax and can behave differently from patterns written for other programming languages.

How to use it

  1. Paste text containing one record per actual line.
  2. Enter the literal query or regular expression.
  3. Choose contains, starts with, ends with, exact, or regex mode.
  4. Set case, inversion, and blank-line options.
  5. Filter, verify the counts, then copy or download the result.

Test a regular expression on a small sample before using it on an important list. An invalid expression is reported without replacing the source text.

Benefits

  • Supports four literal match modes plus regular expressions
  • Can keep matching or non-matching lines
  • Separates blank-line retention from matching
  • Reports matched, kept, and total line counts
  • Provides copy and TXT download actions
  • Processes text locally in the browser

Data limitations

Filtering is literal line-based processing, not structured-record parsing. Keep an original copy and verify boundary cases, capitalization, empty lines, and pattern escaping before using the output in another system.

FAQ

It inverts the decision, removing matching lines and retaining lines that do not match.

No. Only actual newline characters divide records for this tool.

Patterns use the JavaScript RegExp implementation provided by the current browser.

Only when each record is truly one line and the query does not require CSV-aware quote parsing.

No. Filtering, copying, and TXT generation happen locally.

Keep working

Related tools

View all Text Tools