Filter Lines by Regex

Keep or drop lines matching a regex pattern.

About Filter Lines by Regex

Filter Lines by Regex keeps or drops lines that match a regular expression. The pattern is applied to each line independently, and the line count shrinks based on which lines pass the filter — there is no transformation of the matching lines themselves, only inclusion or exclusion. Toggle between Keep matches and Drop matches without retyping the pattern.

This is the only filter in the list-format toolbox: every other tool in this group transforms each line into a different shape, but Filter Regex chooses which lines stay. Reach for it the same way you reach for `grep` and `grep -v`: extract every error line from a paste of logs, drop comment lines from a config, keep only TODO entries from notes, or remove debug lines that match `console\.log`. The pattern is JavaScript regex syntax — case-insensitive, multiline, and other flags are configurable in the pattern bar.

Examples

Input
200 OK /home
500 ERR /login
200 OK /about
503 ERR /api
Output
500 ERR /login
503 ERR /api

Pattern: `^5\d\d` with Keep matches. Switch to Drop matches to invert and keep only the 200s.

Frequently asked questions

Is the match anchored to the whole line?

No. By default the pattern matches anywhere in the line, the same as `grep`. Anchor it explicitly with `^...$` if you need a full-line match.

What regex flavour is supported?

JavaScript regex, since the tool runs in your browser. Most patterns from grep, sed, or Python translate directly; lookbehind and named groups are supported on modern browsers.

Can I extract just the matching part of each line?

Filter Regex only includes or excludes whole lines. To extract substrings — for example, only the URL path from a log line — pair it with another tool: filter first, then run a separate extraction step.

How is this different from Remove Blank Lines?

Remove Blank Lines is a hard-coded special case: drop empty or whitespace-only lines. Filter Regex drops or keeps any pattern you describe, blank or not. Use the simpler tool when the rule is just blanks; this one when the rule is anything else.