Remove Lines Containing Text
Remove every line that contains any of several words or phrases, optionally ignoring case, and keep the remaining lines in order.
What this page does
Filtering a log, a list or a transcript usually means deleting the lines that contain a marker rather than keeping the ones that do. This page removes every line containing any of the phrases you enter, keeps the rest in order, and reads several phrases at once.
How to use it
Paste or type the text and press Run. The result appears beside the form. With "keep me\nTODO: fix this\nkeep me too", the page gives:
keep me
keep me too
The rule it applies
The page removes a line when it contains any of the comma-separated phrases as a substring, case-insensitively by default; the remaining lines are joined back with a newline and their order is preserved.
The surviving lines keep their own text, their order and their blank lines; the phrases are matched as plain text, not as regular expressions, so a dot or a bracket is a literal character. Every character is read in your browser: nothing is uploaded and nothing is stored.
Filtering a log, a list or a transcript usually means deleting the lines that contain a marker rather than keeping the ones that do. This page removes every line containing any of the phrases you enter, keeps the rest in order, and reads several phrases at once.
The rule this page applies: The page removes a line when it contains any of the comma-separated phrases as a substring, case-insensitively by default; the remaining lines are joined back with a newline and their order is preserved.
Worked example: "keep me\nTODO: fix this\nkeep me too" with the default controls gives the output recorded in the example below, character for character.
How to use the Remove Lines Containing Text
Paste or type the text into the box, set Words or phrases (comma-separated), Ignore case, then press Run. The page re-reads whatever is in the box and prints the rule it applied.
Worked example: with "keep me\nTODO: fix this\nkeep me too" the page prints the output in the What to Expect block below, and running it again prints the same bytes.
The rule this page applies
The page removes a line when it contains any of the comma-separated phrases as a substring, case-insensitively by default; the remaining lines are joined back with a newline and their order is preserved.
The surviving lines keep their own text, their order and their blank lines; the phrases are matched as plain text, not as regular expressions, so a dot or a bracket is a literal character.
What to Expect
Best for
- Dropping margin notes from a pasted document
- Removing comment lines from a log
Not ideal for
- Pattern matching, which needs the regex pages
- Keeping only the matching lines, which is the opposite filter
What this tool keeps
- Your text, read in this tab and nowhere else
- The same answer on every run
- Nothing sent, stored or logged
What may need cleanup
- Your own wording, which the page never composes for you
- Spacing carried over from the text you pasted
Common errors
- An empty phrase list is refused, because removing nothing would return the input unchanged under a different name.
- An empty box, which the page refuses rather than printing a blank result
Example use cases
- Stripping TODO lines before a review
- Removing a quoted signature block
Sample input
keep me TODO: fix this keep me too
Sample output
keep me keep me too
Who this is for
- developers
- editors
Frequently asked questions
What rule does this page apply?
The page removes a line when it contains any of the comma-separated phrases as a substring, case-insensitively by default; the remaining lines are joined back with a newline and their order is preserved.
What input does it refuse?
An empty phrase list is refused, because removing nothing would return the input unchanged under a different name.
What is left unchanged?
The surviving lines keep their own text, their order and their blank lines; the phrases are matched as plain text, not as regular expressions, so a dot or a bracket is a literal character.
Is anything uploaded?
No. The text is read by JavaScript in this page and nothing is posted, stored or logged.
Are the phrases regular expressions?
No. Each phrase is a literal substring, so a dot matches a dot. The regex extraction pages are the right tool when a pattern is needed.
How do I remove several different markers?
Separate them with commas. A line is removed when it contains any one of them, so order in the field does not matter.
Build custom tools for your store
Join the SDK program to create useful ecommerce utilities for your store.