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
Can I see surrounding context?
Yes — configurable lines of context before and after each match.
Does it show match counts?
Yes — total matches and matching-line counts are displayed.