Filter Lines Tool
Filter text lines by keyword, pattern, or regex — with live preview and match highlighting
Paste a log file, CSV export, or any block of text and pull out only the lines that match a keyword, phrase, or regex pattern. Six filter modes — Contains, Starts With, Ends With, Exact Match, Does NOT Contain, and Regex — handle everything from a quick string search to complex pattern matching, with results updating live as you type. And everything runs in your browser. Nothing gets uploaded.
How It Works
The tool splits your input into individual lines, then tests each one against your filter pattern using the mode you picked. Matching lines appear in the output panel instantly — no button to click, no waiting. You can flip on "Invert match" to grab everything that doesn't match instead, which is great for stripping out noise.
Examples
Pull Error Lines from a Server Log
Your app crashed overnight. You need just the error entries from a mixed log.
2024-03-15 08:12:01 INFO Server started
2024-03-15 08:14:33 ERROR DB connection refused
2024-03-15 08:14:34 WARN Retrying in 5s
2024-03-15 08:14:39 ERROR DB timeout after 5000ms
2024-03-15 08:15:01 INFO Connection restored
2024-03-15 08:14:33 ERROR DB connection refused
2024-03-15 08:14:39 ERROR DB timeout after 5000ms
Extract Email Addresses with Regex
Mixed list of contact info — some lines have emails, some don't. You only want the ones with valid-looking addresses.
John Smith - Sales Lead
[email protected]
555-0123 (old number)
[email protected]
No email provided
[email protected]
[email protected]
[email protected]
[email protected]
Remove Comment Lines from a Config File
You're cleaning up an nginx config and want to strip out all the comment lines that start with #. Use "Starts with" mode + Invert match.
# Default server block
server {
# Listen on port 80
listen 80;
server_name example.com;
# Redirect to HTTPS
return 301 https://$host$request_uri;
}
server {
listen 80;
server_name example.com;
return 301 https://$host$request_uri;
}
Who Uses This
Pulling specific error types out of application logs during debugging sessions.
Filtering deployment logs to find failed steps or timeout warnings across hundreds of lines.
Cleaning up exported data by removing header rows, blank lines, or entries that don't match a criteria.
Extracting specific entries from keyword lists or pulling URLs from mixed-content documents.
Common Mistakes
You filter for "error" and get lines with "Error", "ERROR", and "error" mixed in. If you need an exact case match, check the "Case sensitive" box. Otherwise you'll pull in more than expected.
Typing something like "user[0]" in Contains mode works fine — it's a plain text search. But switching to Regex mode with the same input breaks because brackets are special regex characters. Escape them as "user\[0\]" or stick with Contains for literal text.
Your lines have leading spaces, so "Starts with" never matches because the line technically starts with whitespace. Turn on "Trim lines" and the tool strips spaces before comparing. Quick fix for indented text.
Technical Details
- Processing: 100% client-side — text never leaves your browser
- Browser Support: Chrome, Firefox, Safari, Edge
- Filter Modes: Contains, Does NOT Contain, Starts With, Ends With, Exact Match, Regex
- Line Limit: No hard cap — handles thousands of lines in real time
- Regex Engine: JavaScript native RegExp with live syntax validation
Frequently Asked Questions
How do I filter lines that contain a specific word?
Paste your text in the left panel and type your word in the filter bar. The default "Contains" mode will show every line where that word appears, regardless of where it sits in the line. Matching parts get highlighted in the output so you can scan results quickly.
Can I use regular expressions to filter text?
Yes. Switch the mode dropdown to "Regex" and type any valid JavaScript regular expression. The tool checks your pattern as you type and shows an error if the syntax is wrong. Patterns like ^\d{3}-\d{4} or (error|warning) work exactly as you'd expect.
How do I remove lines that match instead of keeping them?
Check the "Invert match" option. This flips the logic — only lines that do NOT match your filter will appear in the output. It's perfect for stripping out comment lines, blank entries, or any pattern you want gone.
Is my data safe when using this tool?
Your text stays entirely in your browser. Nothing gets sent to a server — the filtering happens in JavaScript on your machine. Close the tab and it is gone. No cookies, no storage, no tracking.
What's the difference between "Contains" and "Does NOT contain"?
"Contains" keeps lines where your keyword appears somewhere in the line. "Does NOT contain" does the opposite — it keeps every line where the keyword is absent. Think of it as a built-in exclude filter. You can also get the same effect by using "Contains" with "Invert match" checked, but "Does NOT contain" saves you a click.