Regex Grep Simulator
Run a regex against multiple lines of text, filtering to show only matching or non-matching lines.
What is Regex Grep?
A browser-based grep simulator. Just like the Unix grep command, it filters lines of text by a regex pattern, with support for case-insensitive mode, invert matching, and line numbers.
How it works
We split the input by newlines, test each line against the regex, and display matching (or non-matching) lines with line numbers and match highlights.
- Enter your input. Type or paste your input into the field above — the tool responds instantly.
- Review the result. Output updates live as you type. Everything runs entirely in your browser.
- Copy or download. Use the Copy button to grab the result, or Download to save it as a file.
Examples
Filtering log lines
Paste a pattern and some multiline text to see which lines match — grep behavior right in the browser.
Common mistakes
Line vs whole-string matching
Without the multiline flag, ^ and $ anchor to the whole string, not each line — toggle it for line-based results.
Frequently asked questions
How is this different from the regex tester?
The tester works on one subject string and reports match positions. This tool splits your text into lines and filters whole lines, so it answers the grep question: which of these lines match?
Do ^ and $ anchor to the whole text or to each line?
To each line. The input is split on newlines before testing, so anchors behave exactly as they do in grep — and no match can span two lines.
What does invert mode do?
It keeps only the lines that do not match the pattern — the equivalent of running grep with the -v flag.
Is my text uploaded?
No. The pattern and the text are evaluated in your browser; nothing is sent to a server.