Overview
Introduction
Scanning through pasted log output or a long list for lines that mention a specific term, or specifically excluding lines that do, is a common but tedious manual task.
This tool automates it.
What Is String Line Filter?
A line filter that keeps (or, with the invert option, discards) every line containing your search text, matched case-insensitively.
It runs entirely client-side as part of this site's String Tools collection, so nothing you paste is ever uploaded to a server.
How String Line Filter Works
The input is split into lines, and each line is tested for whether it contains the search text (lowercased for a case-insensitive comparison); matching lines are kept or discarded depending on the invert toggle.
The transformation happens synchronously in JavaScript the moment you type, with no network round trip involved.
When To Use String Line Filter
Use it to pull matching lines out of pasted log output, or to strip out lines matching an unwanted pattern.
It's a fast way to get the answer without opening a code editor, a REPL, or writing a one-off script just to check.
Often used alongside Regex Match Extractor and Text Sorter.
Features
Advantages
- Case-insensitive by default, matching common expectations for quick text search.
- Invert option covers both 'keep matches' and 'remove matches' use cases.
Limitations
- Substring matching only, no regex support.
Examples
Best Practices & Notes
Best Practices
- Use Extract Regex Matches instead if you need pattern-based rather than plain substring filtering.
Developer Notes
Matching lowercases both the line and the query before calling String.prototype.includes(), which is a simpler and faster approach than a case-insensitive regex for plain substring matching.
String Line Filter Use Cases
- Pulling error lines out of pasted log output
- Removing lines matching an unwanted keyword
- Quickly searching a pasted list for matching entries
Common Mistakes
- Expecting regex pattern support; matching is a plain substring search.
Tips
- Use the invert toggle to quickly flip between 'show matches' and 'hide matches' without retyping the query.