Filter Lines (Grep for Text)
Keep or delete lines matching plain text, a wildcard or a regular expression. Includes invert match, whole word and extract-only-the-match modes.
What is the Filter Lines (Grep for Text)?
Filter Lines is grep for the browser. Paste any block of text and keep only the lines that match your pattern, or delete them and keep the rest.
- Plain text, wildcard and regular expression matching
- Keep or delete the matching lines
- Ignore case, whole word and invert match options
- Output only the matched text, or a chosen capture group
- Live counts of lines in, lines matched and lines out
- Copy or download the filtered output
How to use the Filter Lines (Grep for Text)
- 1
Paste your text into the input box, one record per line.
- 2
Type a pattern and choose plain text, wildcard or regular expression matching.
- 3
Decide whether matching lines are kept or deleted, and set options such as ignore case or invert match.
- 4
Optionally switch on output only the matched part and choose a capture group.
- 5
Copy or download the filtered result.
About the Filter Lines (Grep for Text)
Filter Lines is grep for the browser. Paste any block of text and keep only the lines that match your pattern, or delete them and keep the rest. Match on plain text, a wildcard pattern using asterisk and question mark, or a full JavaScript regular expression.
Options cover the cases that matter in real work: ignore case, match whole words only, invert the match, and output just the matched part instead of the whole line. When you use a regular expression with capture groups you can pull out a single group, which turns the tool into a quick field extractor for logs and exports.
Everything runs locally in your browser, so log files and exports with sensitive values never leave your device, and the tool keeps working offline once the page has loaded. Live counters show how many lines went in, how many matched and how many came out, which makes it easy to check a pattern is doing what you expect before you copy the result.
Frequently asked questions
How do I grep text without a terminal?
Paste the text, type your pattern, and choose whether to keep or delete the matching lines. It gives the same result as grep or grep -v without installing anything.
What is the difference between wildcard and regex matching?
Wildcards are simpler: asterisk means any run of characters and question mark means exactly one, and the pattern has to cover the whole line. Regular expressions are far more powerful but need the proper syntax.
How do I extract just part of each line?
Switch on output only the matched part. With a regular expression you can also pick a capture group number, so group 1 returns just the first parenthesised section of each match.
What does invert match do?
It flips the test, so lines that would have matched are treated as non-matching and vice versa. Combined with keep or delete it covers every filtering combination you might need.
What happens if my regular expression is invalid?
The tool shows a clear message explaining what the browser could not parse and leaves your text untouched. Nothing crashes and you can fix the pattern and try again.
Related tools
Remove Duplicate Lines
Delete duplicate lines from any list or text instantly. Case-insensitive matching, whitespace trimming and keep-first or keep-last options.
Remove Empty Lines
A free empty line remover that strips blank lines from text or code in one click. Optionally delete whitespace-only lines or collapse multiple blanks into one.
Sort Lines
Sort lines of text alphabetically A to Z or Z to A, by length, numerically, or shuffle randomly. Options to ignore case and remove duplicates.
Find Duplicate Lines
Find and list every line that appears more than once, with its exact occurrence count. Optional case-insensitive matching. Runs 100% in your browser.
Extract Text Between
Extract every substring between a start and end delimiter, such as text inside brackets or tags. Lists each match with a count. 100% in-browser.