Filter Lines
Keep or remove lines matching a substring or regex pattern. Invert match, case-insensitive, trim before match.
How to use
- 1 Paste lines on the left and a pattern below.
- 2 Toggle Keep matching (default) or Remove matching.
- 3 Switch on Regex for full regular expression power, with i / m / u / s flag toggles.
- 4 Copy the filtered result.
Why use this tool
- Plain substring match by default — no regex special-character traps.
- Regex mode with the four most-used JS flags exposed as checkboxes.
- Invert match flips just the match, leaving Keep/Remove logic intact.
- Bad regex shows inline, never crashes the page.
Frequently asked questions
What is the difference between Invert match and switching Keep/Remove?
They are equivalent — "Remove matching X" is the same as "Keep + Invert match on X". The two controls just make common phrasings ("keep lines that do NOT contain", "remove lines that do NOT contain") quick to express.
What do the regex flags do?
i = case-insensitive, m = multiline (^ and $ match each line), u = full Unicode, s = dot matches newline. We always run per-line so m has limited effect here; useful when your pattern itself spans newline-escaped sequences.
How does Trim before match interact?
The line is trimmed only for the match decision; output lines keep their original leading/trailing whitespace.
Related tools?
Use Deduplicate Lines to drop duplicates, or Sort Lines to reorder after filtering.
Filter Lines is a free creator utility by Zerethon Tools. Keep or remove lines matching a substring or regex pattern. Invert match, case-insensitive, trim before match. Runs entirely in the browser — no signup, no upload.
- Category
- Creator
- Pricing
- Free
- Privacy
- Browser-based
- Signup
- Not required
Privacy
Your data never leaves your browser unless explicitly stated. Filter Lines runs entirely client-side — no server upload, no logging, no tracking of your input.
Related tools
YouTube Thumbnail Downloader
Download YouTube thumbnails in all available resolutions. Just paste a video URL.
Open toolOpen Graph Preview
Test how your URL appears when shared on social media. Preview Facebook, Twitter, LinkedIn, and Slack cards.
Open toolWord & Character Counter
Count words, characters, sentences, and paragraphs. Reading time, speaking time, and top keywords — instant.
Open toolLorem Ipsum Generator
Generate Lorem Ipsum placeholder text — by paragraphs, sentences, or words. Optional HTML wrapping.
Open toolBuild, share, and grow on Zerethon Social
Free signup. Earn points, collect achievements, and connect with creators worldwide.