Overview
Introduction
Sometimes an entire sentence needs to go, not just a word, because it references something outdated, off-topic, or sensitive, and finding every such sentence by hand in a long passage is tedious.
This tool runs entirely client-side, so nothing you paste is ever uploaded to a server.
What Is Sentence Remover?
A sentence remover that splits text into sentences and filters out any sentence whose text contains a given keyword, case-insensitively, then rejoins the remaining sentences.
It's distinct from a word remover, which deletes individual word matches; this tool removes the entire sentence a match appears in.
How Sentence Remover Works
The tool matches sentence-ending punctuation followed by whitespace or end-of-string to split the input into an array of trimmed sentences.
It then keeps only the sentences whose lowercased text doesn't contain the lowercased keyword, and joins the survivors back together with single spaces.
When To Use Sentence Remover
Use it to strip out every sentence mentioning a discontinued product, an outdated date, or a name you want scrubbed from a document before sharing it.
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 Sentence Duplicator, Word Remover and Find & Replace Tool.
Features
Advantages
- Removes whole sentences in one pass instead of requiring manual scanning.
- Case-insensitive substring matching catches variations in capitalization automatically.
- Filters the sentences out rather than blanking them, so no empty gaps or orphaned punctuation are left where they used to be.
Limitations
- Sentence detection relies on `.`, `!`, and `?`; abbreviations or decimal numbers can be misread as sentence boundaries.
- Substring matching means a keyword can match inside a longer, unrelated word.
Examples
Best Practices & Notes
Best Practices
- Use a specific enough keyword to avoid accidentally matching unrelated sentences that happen to contain the same substring.
- Review the result afterward for abbreviations that may have split sentences incorrectly.
- Compare the sentence count before and after, since a common keyword can quietly remove far more of the passage than you intended.
Developer Notes
Sentences are matched with `/[^.!?]*[.!?]+(?=\s|$)|[^.!?]+$/g`, then filtered with `sentences.filter((s) => !s.toLowerCase().includes(keyword.toLowerCase()))` before being rejoined with single spaces.
Sentence Remover Use Cases
- Scrubbing sentences that mention a specific name, product, or date from a document
- Filtering out off-topic sentences before publishing a passage
- Cleaning training or sample text of sentences containing a flagged term
Common Mistakes
- Using a very short or common keyword that ends up matching far more sentences than intended.
- Assuming this does whole-word matching; it's a substring match, so partial word matches count too.
Tips
- Combine with a word remover tool if you only need to strip a term rather than an entire sentence.
- Matching runs against the sentence's full text, so a keyword appearing only in a citation or footnote marker still removes the entire sentence.