Text Filter by Line
Keep or remove lines that match a word or regex.
Text Tools Runs in your browser
How do you filter lines of text?
This is grep for a textarea: every line is tested against your pattern and either kept or dropped. Plain substring matching is the default; flip on Regex for full expressions like ^ERROR|WARN, or Ignore case to catch any capitalisation. An invalid regex falls back to a literal search rather than erroring out. Handy for pulling error lines out of a pasted log.
How to use the Text Filter
- 1 Paste the lines to sift through.
- 2 Type a search term, or enable Regex for pattern matching.
- 3 Pick keep or remove, and toggle Ignore case if capitalisation varies.
- 4 Copy the surviving lines.
What you can use it for
- Extracting log lines that contain an error.
- Removing comment or blank lines from a list.
- Filtering a list down to matching entries.
- Stripping unwanted rows before processing.
Frequently asked questions
What is the difference between keep and remove?
Keep mode outputs only matching lines, the equivalent of grep. Remove mode inverts that, like grep -v, leaving every line that does not contain the pattern.
Can I use a regular expression?
Turn on the Regex switch and the pattern is compiled as a full JavaScript regular expression. A pattern that fails to compile is quietly treated as plain text instead.
Is matching case-sensitive?
Until you say otherwise, yes. The Ignore case toggle applies to both modes, so ERROR, Error and error all match a lowercase pattern once it is on.
Related tools
More Text Tools
More tools like this:
All Text Tools