Regex Line Filter — Browser grep

Paste a block of text and a pattern, and instantly see only the lines that match — or, with one click, only the lines that do not. Like grep, but in your browser: optionally number the lines or extract just the matched portion. Great for filtering logs and lists, all computed locally.

How to use the Regex Line Filter — Browser grep

Type a regular expression in Pattern and paste your text into Input lines. By default the tool keeps every line that contains a match and updates the output live; the count line tells you how many of the total lines were kept. Press Copy output to grab the result.

The checkboxes mirror the most-used grep options. Ignore case applies the i flag. Invert flips the filter to keep only the lines that do not match — the equivalent of grep -v, handy for stripping noise. Show line numbers prefixes each kept line with its original position in the input, so you know where it came from. Only matched part outputs just the substring each line matched rather than the whole line — the grep -o behavior — which is perfect for pulling out IDs, URLs, or codes. Invert and only-matched are mutually exclusive, since there is no matched part on a non-matching line.

Matching is per line, so anchors like ^ and $ refer to the start and end of each line. Everything runs in your browser, so you can filter logs and other sensitive text without anything being uploaded, and it works offline.

Line filtering, the grep way

Filtering text line by line against a pattern is one of the most common things developers do, and the canonical tool for it is grep — the Unix utility whose name comes from the old editor command g/re/p, "globally search a regular expression and print." The model is simple and powerful: treat the input as a sequence of lines, test each line against a regex, and emit the lines that match. From that one idea comes a huge amount of daily work — finding error lines in a log, pulling matching entries from a list, narrowing a large file down to the parts you care about.

A few options turn that basic behavior into something far more flexible, and they map directly to grep's famous flags. Inverting the match (grep's -v) keeps the lines that fail the pattern instead, which is the fastest way to remove known noise — drop every line containing "DEBUG," say, and keep the rest. Case-insensitive matching (-i) avoids missing "Error," "ERROR," and "error" when you only typed one of them. Only-matching output (-o) changes the result from whole lines to just the matched substrings, which effectively turns grep into an extraction tool: a pattern like \b\d{3}-\d{4}\b pulls every phone-number-shaped token out of a document, one per line.

Because filtering is per line, the anchors behave intuitively: ^ matches the beginning of each line and $ the end, so ^ERROR finds lines that start with ERROR rather than merely contain it. This line-oriented view is what makes the tool composable in the shell — grep's output is itself lines, ready to pipe into another grep or a counter. Doing the same work in the browser keeps the convenience while adding live feedback and avoiding the need to save text to a file first, which matters when the text is a paste from a log you would rather not write to disk. The result is the same mental model engineers already know, available instantly wherever you are.

Common use cases

  • Log triage. Keep only the error or warning lines from a pasted log, or invert to hide the noise.
  • Extracting tokens. Use only-matched output to pull IDs, URLs, or codes into a clean list.
  • List cleanup. Filter a list down to entries matching a pattern, with optional line numbers.
  • Quick grep. Search text without leaving the browser or writing it to a file first.

Frequently asked questions

How is this different from the match counter?

This tool works line by line and outputs whole lines (or the matched part) like grep, for filtering and extraction. The match counter focuses on counting and tallying individual matches across the whole text.

What does invert do?

It keeps the lines that do not match the pattern — the equivalent of grep -v. It is the quickest way to strip out lines you want to exclude.

What does only matched part output?

Instead of the full line, it outputs just the substring that matched, like grep -o. This turns the filter into an extractor for IDs, URLs, or other tokens.

Do anchors work on each line?

Yes. Matching is per line, so ^ matches the start of a line and $ the end. For example ^ERROR keeps only lines beginning with ERROR.